diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d42dea843b6c..53d6527d40718 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -95,6 +95,8 @@ Anyone may participate in peer review which is expressed by comments in the pull - Concept ACK means "I agree in the general principle of this pull request"; - Nit refers to trivial, often non-blocking issues. +Reviewers should include the commit hash which they reviewed in their comments. + Project maintainers reserve the right to weigh the opinions of peer reviewers using common sense judgement and also may weight based on meritocracy: Those that have demonstrated a deeper commitment and understanding towards the project (over time) or have clear domain expertise may naturally have more weight, as one would expect in all walks of life. Where a patch set affects consensus critical code, the bar will be set much higher in terms of discussion and peer review requirements, keeping in mind that mistakes could be very costly to the wider community. This includes refactoring of consensus critical code. diff --git a/README.md b/README.md index 55ab65a681639..5bf56947d8331 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ License ------- Bitcoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more -information or see http://opensource.org/licenses/MIT. +information or see https://opensource.org/licenses/MIT. Development Process ------------------- diff --git a/configure.ac b/configure.ac index 63a745393e37a..9161e2b2c0b5a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) -define(_CLIENT_VERSION_MINOR, 11) +define(_CLIENT_VERSION_MINOR, 12) define(_CLIENT_VERSION_REVISION, 99) define(_CLIENT_VERSION_BUILD, 0) define(_CLIENT_VERSION_IS_RELEASE, false) diff --git a/contrib/debian/manpages/bitcoin-cli.1 b/contrib/debian/manpages/bitcoin-cli.1 index 154b45873940c..16c338dd3e511 100644 --- a/contrib/debian/manpages/bitcoin-cli.1 +++ b/contrib/debian/manpages/bitcoin-cli.1 @@ -1,4 +1,4 @@ -.TH BITCOIN-CLI "1" "February 2015" "bitcoin-cli 0.10" +.TH BITCOIN-CLI "1" "February 2016" "bitcoin-cli 0.12" .SH NAME bitcoin-cli \- a remote procedure call client for Bitcoin Core. .SH SYNOPSIS @@ -11,31 +11,7 @@ This manual page documents the bitcoin-cli program. bitcoin-cli is an RPC client .SH OPTIONS .TP \fB\-?\fR -Show the help message. -.TP -\fB\-conf=\fR -Specify configuration file (default: bitcoin.conf). -.TP -\fB\-datadir=\fR -Specify data directory. -.TP -\fB\-testnet\fR -Connect to a Bitcoin Core instance running in testnet mode. -.TP -\fB\-regtest\fR -Connect to a Bitcoin Core instance running in regtest mode (see documentation for -regtest on bitcoind). -.TP -\fB\-rpcuser=\fR -Username for JSON\-RPC connections. -.TP -\fB\-rpcpassword=\fR -Password for JSON\-RPC connections. -.TP -\fB\-rpcport=\fR -Listen for JSON\-RPC connections on (default: 8332 or testnet: 18332). -.TP -\fB\-rpcconnect=\fR -Send commands to node running on (default: 127.0.0.1). +Show possible options. .SH "SEE ALSO" \fBbitcoind\fP, \fBbitcoin.conf\fP diff --git a/contrib/debian/manpages/bitcoin-qt.1 b/contrib/debian/manpages/bitcoin-qt.1 index 05eadc94cdd44..685a282080e2b 100644 --- a/contrib/debian/manpages/bitcoin-qt.1 +++ b/contrib/debian/manpages/bitcoin-qt.1 @@ -1,4 +1,4 @@ -.TH BITCOIN-QT "1" "April 2013" "bitcoin-qt 1" +.TH BITCOIN-QT "1" "February 2016" "bitcoin-qt 0.12" .SH NAME bitcoin-qt \- peer-to-peer network based digital currency .SH DESCRIPTION @@ -8,184 +8,6 @@ bitcoin\-qt [command\-line options] .SH OPTIONS .TP \-? -This help message -.TP -\fB\-conf=\fR -Specify configuration file (default: bitcoin.conf) -.TP -\fB\-pid=\fR -Specify pid file (default: bitcoind.pid) -.TP -\fB\-gen\fR -Generate coins -.TP -\fB\-gen\fR=\fI0\fR -Don't generate coins -.TP -\fB\-datadir=\fR -Specify data directory -.TP -\fB\-dbcache=\fR -Set database cache size in megabytes (default: 25) -.TP -\fB\-timeout=\fR -Specify connection timeout in milliseconds (default: 5000) -.TP -\fB\-proxy=\fR -Connect through SOCKS5 proxy -.TP -\fB\-tor=\fR -Use proxy to reach tor hidden services (default: same as \fB\-proxy\fR) -.TP -\fB\-dns\fR -Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR -.TP -\fB\-port=\fR -Listen for connections on (default: 8333 or testnet: 18333) -.TP -\fB\-maxconnections=\fR -Maintain at most connections to peers (default: 125) -.TP -\fB\-addnode=\fR -Add a node to connect to and attempt to keep the connection open -.TP -\fB\-connect=\fR -Connect only to the specified node(s) -.TP -\fB\-seednode=\fR -Connect to a node to retrieve peer addresses, and disconnect -.TP -\fB\-externalip=\fR -Specify your own public address -.TP -\fB\-onlynet=\fR -Only connect to nodes in network (IPv4, IPv6 or Tor) -.TP -\fB\-discover\fR -Discover own IP address (default: 1 when listening and no \fB\-externalip\fR) -.TP -\fB\-checkpoints\fR -Only accept block chain matching built\-in checkpoints (default: 1) -.TP -\fB\-listen\fR -Accept connections from outside (default: 1 if no \fB\-proxy\fR or \fB\-connect\fR) -.TP -\fB\-bind=\fR -Bind to given address and always listen on it. Use [host]:port notation for IPv6 -.TP -\fB\-dnsseed\fR -Find peers using DNS lookup (default: 1 unless \fB\-connect\fR) -.TP -\fB\-banscore=\fR -Threshold for disconnecting misbehaving peers (default: 100) -.TP -\fB\-bantime=\fR -Number of seconds to keep misbehaving peers from reconnecting (default: 86400) -.TP -\fB\-maxreceivebuffer=\fR -Maximum per\-connection receive buffer, *1000 bytes (default: 5000) -.TP -\fB\-maxsendbuffer=\fR -Maximum per\-connection send buffer, *1000 bytes (default: 1000) -.TP -\fB\-upnp\fR -Use UPnP to map the listening port (default: 1 when listening) -.TP -\fB\-paytxfee=\fR -Fee per KB to add to transactions you send -.TP -\fB\-server\fR -Accept command line and JSON\-RPC commands -.TP -\fB\-testnet\fR -Use the test network -.TP -\fB\-debug\fR -Output extra debugging information. Implies all other \fB\-debug\fR* options -.TP -\fB\-debugnet\fR -Output extra network debugging information -.TP -\fB\-logtimestamps\fR -Prepend debug output with timestamp -.TP -\fB\-shrinkdebugfile\fR -Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR) -.TP -\fB\-printtoconsole\fR -Send trace/debug info to console instead of debug.log file -.TP -\fB\-rpcuser=\fR -Username for JSON\-RPC connections -.TP -\fB\-rpcpassword=\fR -Password for JSON\-RPC connections -.TP -\fB\-rpcport=\fR -Listen for JSON\-RPC connections on (default: 8332 or testnet: 18332) -.TP -\fB\-rpcallowip=\fR -Allow JSON\-RPC connections from specified IP address -.TP -\fB\-rpcthreads=\fR -Set the number of threads to service RPC calls (default: 4) -.TP -\fB\-blocknotify=\fR -Execute command when the best block changes (%s in cmd is replaced by block hash) -.TP -\fB\-walletnotify=\fR -Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) -.TP -\fB\-alertnotify=\fR -Execute command when a relevant alert is received (%s in cmd is replaced by message) -.TP -\fB\-upgradewallet\fR -Upgrade wallet to latest format -.TP -\fB\-keypool=\fR -Set key pool size to (default: 100) -.TP -\fB\-rescan\fR -Rescan the block chain for missing wallet transactions -.TP -\fB\-salvagewallet\fR -Attempt to recover private keys from a corrupt wallet.dat -.TP -\fB\-checkblocks=\fR -How many blocks to check at startup (default: 288, 0 = all) -.TP -\fB\-checklevel=\fR -How thorough the block verification is (0\-4, default: 3) -.TP -\fB\-txindex\fR -Maintain a full transaction index (default: 0) -.TP -\fB\-loadblock=\fR -Imports blocks from external blk000??.dat file -.TP -\fB\-reindex\fR -Rebuild block chain index from current blk000??.dat files -.TP -\fB\-par=\fR -Set the number of script verification threads (1\-16, 0=auto, default: 0) -.SS "Block creation options:" -.TP -\fB\-blockminsize=\fR -Set minimum block size in bytes (default: 0) -.TP -\fB\-blockmaxsize=\fR -Set maximum block size in bytes (default: 250000) -.HP -\fB\-blockprioritysize=\fR Set maximum size of high\-priority/low\-fee transactions in bytes (default: 27000) -.PP -Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH) -.SS "UI options:" -.TP -\fB\-lang=\fR -Set language, for example "de_DE" (default: system locale) -.TP -\fB\-min\fR -Start minimized -.TP -\fB\-splash\fR -Show splash screen on startup (default: 1) +List options. +.SH "SEE ALSO" +bitcoind(1) diff --git a/contrib/debian/manpages/bitcoin.conf.5 b/contrib/debian/manpages/bitcoin.conf.5 index 0cf4d991e34c9..839dc26c1aa57 100644 --- a/contrib/debian/manpages/bitcoin.conf.5 +++ b/contrib/debian/manpages/bitcoin.conf.5 @@ -1,75 +1,15 @@ -.TH BITCOIN.CONF "5" "January 2011" "bitcoin.conf 3.19" +.TH BITCOIN.CONF "5" "February 2016" "bitcoin.conf 0.12" .SH NAME bitcoin.conf \- bitcoin configuration file .SH SYNOPSIS All command-line options (except for '\-conf') may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file. .TP -The configuration file is a list of 'setting=value' pairs, one per line, with optional comments starting with the '#' character. +The configuration file is a list of 'setting=value' pairs, one per line, with optional comments starting with the '#' character. Please refer to bitcoind(1) for a up to date list of valid options. .TP The configuration file is not automatically created; you can create it using your favorite plain-text editor. By default, bitcoind(1) will look for a file named bitcoin.conf(5) in the bitcoin data directory, but both the data directory and the configuration file path may be changed using the '\-datadir' and '\-conf' command-line arguments. .SH LOCATION bitcoin.conf should be located in $HOME/.bitcoin -.SH NETWORK-RELATED SETTINGS -.TP -.TP -\fBtestnet=\fR[\fI'1'\fR|\fI'0'\fR] -Enable or disable run on the test network instead of the real *bitcoin* network. -.TP -\fBproxy=\fR\fI'127.0.0.1:9050'\fR -Connect via a socks4 proxy. -.TP -\fBaddnode=\fR\fI'10.0.0.2:8333'\fR -Use as many *addnode=* settings as you like to connect to specific peers. -.TP -\fBconnect=\fR\fI'10.0.0.1:8333'\fR -Use as many *connect=* settings as you like to connect ONLY to specific peers. -.TP -\fRmaxconnections=\fR\fI'value'\fR -Maximum number of inbound+outbound connections. -.SH JSON-RPC OPTIONS -.TP -\fBserver=\fR[\fI'1'\fR|\fI'0'\fR] -Tells *bitcoin* to accept or not accept JSON-RPC commands. -.TP -\fBrpcuser=\fR\fI'username'\fR -You must set *rpcuser* to secure the JSON-RPC api. -.TP -\fBrpcpassword=\fR\fI'password'\fR -You must set *rpcpassword* to secure the JSON-RPC api. -.TP -\fBrpcallowip=\fR\fI'192.168.1.*'\fR -By default, only RPC connections from localhost are allowed. Specify as many *rpcallowip=* settings as you like to allow connections from other hosts (and you may use * as a wildcard character). -.TP -\fBrpcport=\fR\fI'8332'\fR -Listen for RPC connections on this TCP port. -.TP -\fBrpcconnect=\fR\fI'127.0.0.1'\fR -You can use *bitcoin* or *bitcoind(1)* to send commands to *bitcoin*/*bitcoind(1)* running on another host using this option. -.TP -.SH MISCELLANEOUS OPTIONS -.TP -\fBgen=\fR[\fI'0'\fR|\fI'1'\fR] -Enable or disable attempt to generate bitcoins. -.TP -\fB4way=\fR[\fI'0'\fR|\fI'1'\fR] -Enable or disable use SSE instructions to try to generate bitcoins faster. -.TP -\fBkeypool=\fR\fI'100'\fR -Pre-generate this many public/private key pairs, so wallet backups will be valid for both prior transactions and several dozen future transactions. -.TP -\fBpaytxfee=\fR\fI'0.00'\fR -Pay an optional transaction fee every time you send bitcoins. Transactions with fees are more likely than free transactions to be included in generated blocks, so may be validated sooner. -.TP -\fBallowreceivebyip=\fR\fI'1'\fR -Allow direct connections for the 'pay via IP address' feature. -.TP -.SH USER INTERFACE OPTIONS -.TP -\fBmin=\fR[\fI'0'\fR|\fI'1'\fR] -Enable or disable start bitcoind minimized. -.TP -\fBminimizetotray=\fR[\fI'0'\fR|\fI'1'\fR] -Enable or disable minimize to the system tray. + .SH "SEE ALSO" bitcoind(1) .SH AUTHOR diff --git a/contrib/debian/manpages/bitcoind.1 b/contrib/debian/manpages/bitcoind.1 index 5b0f2921aa415..5c3e52f441e9e 100644 --- a/contrib/debian/manpages/bitcoind.1 +++ b/contrib/debian/manpages/bitcoind.1 @@ -1,4 +1,4 @@ -.TH BITCOIND "1" "January 2011" "bitcoind 3.19" +.TH BITCOIND "1" "February 2016" "bitcoind 0.12" .SH NAME bitcoind \- peer-to-peer network based digital currency .SH SYNOPSIS @@ -6,185 +6,20 @@ bitcoin [options] [params] .TP bitcoin [options] help \- Get help for a command .SH DESCRIPTION -This manual page documents the bitcoind program. Bitcoin is a peer-to-peer digital currency. Peer-to-peer (P2P) means that there is no central authority to issue new money or keep track of transactions. Instead, these tasks are managed collectively by the nodes of the network. Advantages: - -Bitcoins can be sent easily through the Internet, without having to trust middlemen. Transactions are designed to be irreversible. Be safe from instability caused by fractional reserve banking and central banks. The limited inflation of the Bitcoin system’s money supply is distributed evenly (by CPU power) throughout the network, not monopolized by banks. +This manual page documents the bitcoind program. Bitcoin is an experimental new digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin Core is the name of open source software which enables the use of this currency. .SH OPTIONS .TP -\fB\-conf=\fR -Specify configuration file (default: bitcoin.conf) -.TP -\fB\-gen\fR -Generate coins -.TP -\fB\-gen\fR=\fI0\fR -Don't generate coins -.TP -\fB\-min\fR -Start minimized -.TP -\fB\-datadir=\fR -Specify data directory -.TP -\fB\-proxy=\fR -Connect through SOCKS5 proxy -.TP -\fB\-addnode=\fR -Add a node to connect to -.TP -\fB\-connect=\fR -Connect only to the specified node -.TP -\fB\-paytxfee=\fR -Fee per KB to add to transactions you send -.TP -\fB\-server\fR -Accept command line and JSON\-RPC commands -.TP -\fB\-daemon\fR -Run in the background as a daemon and accept commands -.TP -\fB\-testnet\fR -Use the test network -.TP -\fB\-rpcuser=\fR -Username for JSON\-RPC connections -.TP -\fB\-rpcpassword=\fR -Password for JSON\-RPC connections -.TP -\fB\-rpcport=\fR -Listen for JSON\-RPC connections on -.TP -\fB\-rpcallowip=\fR -Allow JSON\-RPC connections from specified IP address -.TP -\fB\-rpcconnect=\fR -Send commands to node running on -.TP \-? -This help message +List of possible options. .SH COMMANDS .TP -\fBbackupwallet 'destination'\fR -Safely copies *wallet.dat* to 'destination', which can be a directory or a path with filename. -.TP -\fBgetaccount 'bitcoinaddress'\fR -DEPRECATED. Returns the account associated with the given address. -.TP -\fBsetaccount 'bitcoinaddress' ['account']\fR -DEPRECATED. Sets the ['account'] associated with the given address. ['account'] may be omitted to remove an address from ['account']. -.TP -\fBgetaccountaddress 'account'\fR -DEPRECATED. Returns a new bitcoin address for 'account'. -.TP -\fBgetaddressesbyaccount 'account'\fR -DEPRECATED. Returns the list of addresses associated with the given 'account'. -.TP -\fBgetbalance 'account'\fR -Returns the server's available balance, or the balance for 'account' (accounts are deprecated). -.TP -\fBgetblockcount\fR -Returns the number of blocks in the longest block chain. -.TP -\fBgetblocknumber\fR -Returns the block number of the latest block in the longest block chain. -.TP -\fBgetconnectioncount\fR -Returns the number of connections to other nodes. -.TP -\fBgetdifficulty\fR -Returns the proof-of-work difficulty as a multiple of the minimum difficulty. -.TP -\fBgetgenerate\fR -Returns boolean true if server is trying to generate bitcoins, false otherwise. -.TP -\fBsetgenerate 'generate' ['genproclimit']\fR -Generation is limited to ['genproclimit'] processors, \-1 is unlimited. -.TP -\fBgethashespersec\fR -Returns a recent hashes per second performance measurement while generating. -.TP -\fBgetinfo\fR -Returns an object containing server information. -.TP -\fBgetnewaddress 'account'\fR -Returns a new bitcoin address for receiving payments. If 'account' is specified (deprecated), it is added to the address book so payments received with the address will be credited to 'account'. -.TP -\fBgetreceivedbyaccount 'account' ['minconf=1']\fR -DEPRECATED. Returns the total amount received by addresses associated with 'account' in transactions with at least ['minconf'] confirmations. -.TP -\fBgetreceivedbyaddress 'bitcoinaddress' ['minconf=1']\fR -Returns the total amount received by 'bitcoinaddress' in transactions with at least ['minconf'] confirmations. -.TP -\fBgettransaction 'txid'\fR -Returns information about a specific transaction, given hexadecimal transaction ID. -.TP -\fBgetwork 'data'\fR -If 'data' is specified, tries to solve the block and returns true if it was successful. If 'data' is not specified, returns formatted hash 'data' to work on: +\fBhelp\fR +List commands. - "midstate" : precomputed hash state after hashing the first half of the data. - "data" : block data. - "hash1" : formatted hash buffer for second hash. - "target" : little endian hash target. .TP \fBhelp 'command'\fR -List commands, or get help for a command. -.TP -\fBlistaccounts ['minconf=1']\fR -DEPRECATED. List accounts and their current balances. - *note: requires bitcoin 0.3.20 or later. -.TP -\fBlistreceivedbyaccount ['minconf=1'] ['includeempty=false']\fR -['minconf'] is the minimum number of confirmations before payments are included. ['includeempty'] whether to include addresses that haven't received any payments. Returns an array of objects containing: - - "account" : DEPRECATED. the account of the receiving address. - "amount" : total amount received by the address. - "confirmations" : number of confirmations of the most recent transaction included. -.TP -\fBlistreceivedbyaddress ['minconf=1'] ['includeempty=false']\fR -['minconf'] is the minimum number of confirmations before payments are included. ['includeempty'] whether to include addresses that haven't received any payments. Returns an array of objects containing: - - "address" : receiving address. - "account" : DEPRECATED. the account of the receiving address. - "amount" : total amount received by the address. - "confirmations" : number of confirmations of the most recent transaction included. -.TP -\fBlisttransactions 'account' ['count=10']\fR -Returns a list of the last ['count'] transactions for 'account' \- for all accounts if 'account' is not specified or is "*". Each entry in the list may contain: - - "category" : will be generate, send, receive, or move. - "amount" : amount of transaction. - "fee" : Fee (if any) paid (only for send transactions). - "confirmations" : number of confirmations (only for generate/send/receive). - "txid" : transaction ID (only for generate/send/receive). - "otheraccount" : account funds were moved to or from (only for move). - "message" : message associated with transaction (only for send). - "to" : message-to associated with transaction (only for send). - - *note: requires bitcoin 0.3.20 or later. -.TP -\fBmove <'fromaccount'> <'toaccount'> <'amount'> ['minconf=1'] ['comment']\fR -DEPRECATED. Moves funds between accounts. -.TP -\fBsendfrom* <'account'> <'bitcoinaddress'> <'amount'> ['minconf=1'] ['comment'] ['comment-to']\fR -DEPRECATED. Sends amount from account's balance to 'bitcoinaddress'. This method will fail if there is less than amount bitcoins with ['minconf'] confirmations in the account's balance (unless account is the empty-string-named default account; it behaves like the *sendtoaddress* method). Returns transaction ID on success. -.TP -\fBsendtoaddress 'bitcoinaddress' 'amount' ['comment'] ['comment-to']\fR -Sends amount from the server's available balance to 'bitcoinaddress'. amount is a real and is rounded to the nearest 0.01. Returns transaction id on success. -.TP -\fBstop\fR -Stops the bitcoin server. -.TP -\fBvalidateaddress 'bitcoinaddress'\fR -Checks that 'bitcoinaddress' looks like a proper bitcoin address. Returns an object containing: - - "isvalid" : true or false. - "ismine" : true if the address is in the server's wallet. - "address" : bitcoinaddress. - - *note: ismine and address are only returned if the address is valid. +Get help for a command. .SH "SEE ALSO" bitcoin.conf(5) diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index a58b8733a63d0..240ab6d9e0bad 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -11,16 +11,16 @@ fix-copyright-headers.py ======================== Every year newly updated files need to have its copyright headers updated to reflect the current year. -If you run this script from src/ it will automatically update the year on the copyright header for all -.cpp and .h files if these have a git commit from the current year. +If you run this script from the root folder it will automatically update the year on the copyright header for all +source files if these have a git commit from the current year. -For example a file changed in 2014 (with 2014 being the current year): +For example a file changed in 2015 (with 2015 being the current year): ```// Copyright (c) 2009-2013 The Bitcoin Core developers``` would be changed to: -```// Copyright (c) 2009-2014 The Bitcoin Core developers``` +```// Copyright (c) 2009-2015 The Bitcoin Core developers``` git-subtree-check.sh ==================== diff --git a/contrib/devtools/fix-copyright-headers.py b/contrib/devtools/fix-copyright-headers.py index 5e849525485bc..b6414a551f870 100755 --- a/contrib/devtools/fix-copyright-headers.py +++ b/contrib/devtools/fix-copyright-headers.py @@ -1,53 +1,46 @@ #!/usr/bin/env python ''' -Run this script inside of src/ and it will look for all the files -that were changed this year that still have the last year in the -copyright headers, and it will fix the headers on that file using -a perl regex one liner. +Run this script to update all the copyright headers of files +that were changed this year. -For example: if it finds something like this and we're in 2014 +For example: -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2012 The Bitcoin Core developers it will change it to -// Copyright (c) 2009-2014 The Bitcoin Core developers - -It will do this for all the files in the folder and its children. - -Author: @gubatron +// Copyright (c) 2009-2015 The Bitcoin Core developers ''' import os import time +import re year = time.gmtime()[0] -last_year = year - 1 -command = "perl -pi -e 's/%s The Bitcoin/%s The Bitcoin/' %s" -listFilesCommand = "find . | grep %s" - -extensions = [".cpp",".h"] - -def getLastGitModifiedDate(filePath): - gitGetLastCommitDateCommand = "git log " + filePath +" | grep Date | head -n 1" - p = os.popen(gitGetLastCommitDateCommand) - result = "" - for l in p: - result = l - break - result = result.replace("\n","") - return result +CMD_GIT_DATE = 'git log --format=@%%at -1 %s | date +"%%Y" -u -f -' +CMD_REGEX= "perl -pi -e 's/(20\d\d)(?:-20\d\d)? The Bitcoin/$1-%s The Bitcoin/' %s" +REGEX_CURRENT= re.compile("%s The Bitcoin" % year) +CMD_LIST_FILES= "find %s | grep %s" -n=1 -for extension in extensions: - foundFiles = os.popen(listFilesCommand % extension) - for filePath in foundFiles: - filePath = filePath[1:-1] - if filePath.endswith(extension): - filePath = os.getcwd() + filePath - modifiedTime = getLastGitModifiedDate(filePath) - if len(modifiedTime) > 0 and str(year) in modifiedTime: - print n,"Last Git Modified: ", modifiedTime, " - ", filePath - os.popen(command % (last_year,year,filePath)) - n = n + 1 +FOLDERS = ["./qa", "./src"] +EXTENSIONS = [".cpp",".h", ".py"] +def get_git_date(file_path): + r = os.popen(CMD_GIT_DATE % file_path) + for l in r: + # Result is one line, so just return + return l.replace("\n","") + return "" +n=1 +for folder in FOLDERS: + for extension in EXTENSIONS: + for file_path in os.popen(CMD_LIST_FILES % (folder, extension)): + file_path = os.getcwd() + file_path[1:-1] + if file_path.endswith(extension): + git_date = get_git_date(file_path) + if str(year) == git_date: + # Only update if current year is not found + if REGEX_CURRENT.search(open(file_path, "r").read()) is None: + print n,"Last git edit", git_date, "-", file_path + os.popen(CMD_REGEX % (year,file_path)) + n = n + 1 diff --git a/contrib/devtools/update-translations.py b/contrib/devtools/update-translations.py index ea209eec7e4df..2b6e807b4718c 100755 --- a/contrib/devtools/update-translations.py +++ b/contrib/devtools/update-translations.py @@ -72,7 +72,7 @@ def sanitize_string(s): '''Sanitize string for printing''' return s.replace('\n',' ') -def check_format_specifiers(source, translation, errors): +def check_format_specifiers(source, translation, errors, numerus): source_f = split_format_specifiers(find_format_specifiers(source)) # assert that no source messages contain both Qt and strprintf format specifiers # if this fails, go change the source as this is hacky and confusing! @@ -80,10 +80,13 @@ def check_format_specifiers(source, translation, errors): try: translation_f = split_format_specifiers(find_format_specifiers(translation)) except IndexError: - errors.append("Parse error in translation '%s'" % sanitize_string(translation)) + errors.append("Parse error in translation for '%s': '%s'" % (sanitize_string(source), sanitize_string(translation))) return False else: if source_f != translation_f: + if numerus and source_f == (set(), ['n']) and translation_f == (set(), []) and translation.find('%') == -1: + # Allow numerus translations to omit %n specifier (usually when it only has one possible value) + return True errors.append("Mismatch between '%s' and '%s'" % (sanitize_string(source), sanitize_string(translation))) return False return True @@ -150,7 +153,7 @@ def postprocess_translations(reduce_diff_hacks=False): if translation is None: continue errors = [] - valid = check_format_specifiers(source, translation, errors) + valid = check_format_specifiers(source, translation, errors, numerus) for error in errors: print('%s: %s' % (filename, error)) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index 0c3c439dd9631..ee852ff138ea5 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -1,5 +1,5 @@ --- -name: "bitcoin-linux-0.12" +name: "bitcoin-linux-0.13" enable_cache: true suites: - "trusty" @@ -15,7 +15,7 @@ packages: - "faketime" - "bsdmainutils" - "binutils-gold" -reference_datetime: "2015-06-01 00:00:00" +reference_datetime: "2016-01-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml index aa9494b7ed69e..5b52c492fddbb 100644 --- a/contrib/gitian-descriptors/gitian-osx-signer.yml +++ b/contrib/gitian-descriptors/gitian-osx-signer.yml @@ -7,7 +7,7 @@ architectures: packages: - "libc6:i386" - "faketime" -reference_datetime: "2015-06-01 00:00:00" +reference_datetime: "2016-01-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git" "dir": "signature" diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 9ac774c8a05b9..7e40803a0712f 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -1,5 +1,5 @@ --- -name: "bitcoin-osx-0.12" +name: "bitcoin-osx-0.13" enable_cache: true suites: - "trusty" @@ -18,7 +18,7 @@ packages: - "libcap-dev" - "libz-dev" - "libbz2-dev" -reference_datetime: "2015-06-01 00:00:00" +reference_datetime: "2016-01-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" diff --git a/contrib/gitian-descriptors/gitian-win-signer.yml b/contrib/gitian-descriptors/gitian-win-signer.yml index a29d7ab472576..27c4f01eb4ed9 100644 --- a/contrib/gitian-descriptors/gitian-win-signer.yml +++ b/contrib/gitian-descriptors/gitian-win-signer.yml @@ -7,7 +7,7 @@ architectures: packages: - "libssl-dev" - "autoconf" -reference_datetime: "2015-06-01 00:00:00" +reference_datetime: "2016-01-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git" "dir": "signature" diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index 6bb482d45f373..c8fbe32eee97f 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -1,5 +1,5 @@ --- -name: "bitcoin-win-0.12" +name: "bitcoin-win-0.13" enable_cache: true suites: - "trusty" @@ -18,7 +18,7 @@ packages: - "g++-mingw-w64" - "nsis" - "zip" -reference_datetime: "2015-06-01 00:00:00" +reference_datetime: "2016-01-01 00:00:00" remotes: - "url": "https://github.com/bitcoin/bitcoin.git" "dir": "bitcoin" diff --git a/depends/config.guess b/depends/config.guess index b3f905370ac63..fba6e87a0f87a 100755 --- a/depends/config.guess +++ b/depends/config.guess @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. -timestamp='2015-10-21' +timestamp='2015-11-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -1393,6 +1393,9 @@ EOF x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < - - SSLEngine On - SSLCertificateFile /etc/apache2/ssl/server.crt - SSLCertificateKeyFile /etc/apache2/ssl/server.key - - - ProxyPass http://127.0.0.1:8332/ - ProxyPassReverse http://127.0.0.1:8332/ - # optional enable digest auth - # AuthType Digest - # ... - - # optional bypass bitcoind rpc basic auth - # RequestHeader set Authorization "Basic " - # get the from the shell with: base64 <<< bitcoinrpc: - - - # Or, balance the load: - # ProxyPass / balancer://balancer_cluster_name - - - -Random-cookie RPC authentication ---------------------------------- - -When no `-rpcpassword` is specified, the daemon now uses a special 'cookie' -file for authentication. This file is generated with random content when the -daemon starts, and deleted when it exits. Its contents are used as -authentication token. Read access to this file controls who can access through -RPC. By default it is stored in the data directory but its location can be -overridden with the option `-rpccookiefile`. - -This is similar to Tor's CookieAuthentication: see -https://www.torproject.org/docs/tor-manual.html.en - -This allows running bitcoind without having to do any manual configuration. - -Low-level RPC API changes --------------------------- - -- Monetary amounts can be provided as strings. This means that for example the - argument to sendtoaddress can be "0.0001" instead of 0.0001. This can be an - advantage if a JSON library insists on using a lossy floating point type for - numbers, which would be dangerous for monetary amounts. - -Option parsing behavior ------------------------ - -Command line options are now parsed strictly in the order in which they are -specified. It used to be the case that `-X -noX` ends up, unintuitively, with X -set, as `-X` had precedence over `-noX`. This is no longer the case. Like for -other software, the last specified value for an option will hold. - -`NODE_BLOOM` service bit ------------------------- - -Support for the `NODE_BLOOM` service bit, as described in [BIP -111](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki), has been -added to the P2P protocol code. - -BIP 111 defines a service bit to allow peers to advertise that they support -bloom filters (such as used by SPV clients) explicitly. It also bumps the protocol -version to allow peers to identify old nodes which allow bloom filtering of the -connection despite lacking the new service bit. - -In this version, it is only enforced for peers that send protocol versions -`>=70011`. For the next major version it is planned that this restriction will be -removed. It is recommended to update SPV clients to check for the `NODE_BLOOM` -service bit for nodes that report versions newer than 70011. - -Any sequence of pushdatas in OP_RETURN outputs now allowed ----------------------------------------------------------- - -Previously OP_RETURN outputs with a payload were only relayed and mined if they -had a single pushdata. This restriction has been lifted to allow any -combination of data pushes and numeric constant opcodes (OP_1 to OP_16). The -limit on OP_RETURN output size is now applied to the entire serialized -scriptPubKey, 83 bytes by default. (the previous 80 byte default plus three -bytes overhead) - -Merkle branches removed from wallet ------------------------------------ - -Previously, every wallet transaction stored a Merkle branch to prove its -presence in blocks. This wasn't being used for more than an expensive -sanity check. Since 0.12, these are no longer stored. When loading a -0.12 wallet into an older version, it will automatically rescan to avoid -failed checks. - -BIP65 - CHECKLOCKTIMEVERIFY ---------------------------- - -Previously it was impossible to create a transaction output that was guaranteed -to be unspendable until a specific date in the future. CHECKLOCKTIMEVERIFY is a -new opcode that allows a script to check if a specific block height or time has -been reached, failing the script otherwise. This enables a wide variety of new -functionality such as time-locked escrows, secure payment channels, etc. - -BIP65 implements CHECKLOCKTIMEVERIFY by introducing block version 4, which adds -additional restrictions to the NOP2 opcode. The same miner-voting mechanism as -in BIP34 and BIP66 is used: when 751 out of a sequence of 1001 blocks have -version number 4 or higher, the new consensus rule becomes active for those -blocks. When 951 out of a sequence of 1001 blocks have version number 4 or -higher, it becomes mandatory for all blocks and blocks with versions less than -4 are rejected. - -Bitcoin Core's block templates are now for version 4 blocks only, and any -mining software relying on its `getblocktemplate` must be updated in parallel -to use either libblkmaker version 0.4.3 or any version from 0.5.2 onward. If -you are solo mining, this will affect you the moment you upgrade Bitcoin Core, -which must be done prior to BIP65 achieving its 951/1001 status. If you are -mining with the stratum mining protocol: this does not affect you. If you are -mining with the getblocktemplate protocol to a pool: this will affect you at -the pool operator's discretion, which must be no later than BIP65 achieving its -951/1001 status. - -Automatically use Tor hidden services -------------------------------------- - -Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket -API, to create and destroy 'ephemeral' hidden services programmatically. -Bitcoin Core has been updated to make use of this. - -This means that if Tor is running (and proper authorization is available), -Bitcoin Core automatically creates a hidden service to listen on, without -manual configuration. Bitcoin Core will also use Tor automatically to connect -to other .onion nodes if the control socket can be successfully opened. This -will positively affect the number of available .onion nodes and their usage. - -This new feature is enabled by default if Bitcoin Core is listening, and -a connection to Tor can be made. It can be configured with the `-listenonion`, -`-torcontrol` and `-torpassword` settings. To show verbose debugging -information, pass `-debug=tor`. - -Reduce upload traffic ---------------------- - -A major part of the outbound traffic is caused by serving historic blocks to -other nodes in initial block download state. - -It is now possible to reduce the total upload traffic via the `-maxuploadtarget` -parameter. This is *not* a hard limit but a threshold to minimize the outbound -traffic. When the limit is about to be reached, the uploaded data is cut by not -serving historic blocks (blocks older than one week). -Moreover, any SPV peer is disconnected when they request a filtered block. - -This option can be specified in MiB per day and is turned off by default -(`-maxuploadtarget=0`). -The recommended minimum is 144 * MAX_BLOCK_SIZE (currently 144MB) per day. - -Whitelisted peers will never be disconnected, although their traffic counts for -calculating the target. - -A more detailed documentation about keeping traffic low can be found in -[/doc/reducetraffic.md](/doc/reducetraffic.md). - -Signature validation using libsecp256k1 ---------------------------------------- - -ECDSA signatures inside Bitcoin transactions now use validation using -[https://github.com/bitcoin/secp256k1](libsecp256k1) instead of OpenSSL. - -Depending on the platform, this means a significant speedup for raw signature -validation speed. The advantage is largest on x86_64, where validation is over -five times faster. In practice, this translates to a raw reindexing and new -block validation times that are less than half of what it was before. - -Libsecp256k1 has undergone very extensive testing and validation. - -A side effect of this change is that libconsensus no longer depends on OpenSSL. - -Direct headers announcement (BIP 130) -------------------------------------- - -Between compatible peers, BIP 130 direct headers announcement is used. This -means that blocks are advertized by announcing their headers directly, instead -of just announcing the hash. In a reorganization, all new headers are sent, -instead of just the new tip. This can often prevent an extra roundtrip before -the actual block is downloaded. - -Negative confirmations and conflict detection ---------------------------------------------- - -The wallet will now report a negative number for confirmations that indicates -how deep in the block chain the conflict is found. For example, if a transaction -A has 5 confirmations and spends the same input as a wallet transaction B, B -will be reported as having -5 confirmations. If another wallet transaction C -spends an output from B, it will also be reported as having -5 confirmations. -To detect conflicts with historical transactions in the chain a one-time -`-rescan` may be needed. - -Unlike earlier versions, unconfirmed but non-conflicting transactions will never -get a negative confirmation count. They are not treated as spendable unless -they're coming from ourself (change) and accepted into our local mempool, -however. The new "trusted" field in the `listtransactions` RPC output -indicates whether outputs of an unconfirmed transaction are considered -spendable. - -0.12.0 Change log +0.13.0 Change log ================= Detailed release notes follow. This overview includes changes that affect @@ -243,33 +18,20 @@ git merge commit are mentioned. ### RPC and REST -Asm representations of scriptSig signatures now contain SIGHASH type decodes ----------------------------------------------------------------------------- - -The `asm` property of each scriptSig now contains the decoded signature hash -type for each signature that provides a valid defined hash type. +Asm script outputs now contain OP_CHECKLOCKTIMEVERIFY in place of OP_NOP2 +------------------------------------------------------------------------- -The following items contain assembly representations of scriptSig signatures -and are affected by this change: +OP_NOP2 has been renamed to OP_CHECKLOCKTIMEVERIFY by [BIP +65](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki) -- RPC `getrawtransaction` +The following outputs are affected by this change: +- RPC `getrawtransaction` (in verbose mode) - RPC `decoderawtransaction` +- RPC `decodescript` - REST `/rest/tx/` (JSON format) - REST `/rest/block/` (JSON format when including extended tx details) - `bitcoin-tx -json` -For example, the `scriptSig.asm` property of a transaction input that -previously showed an assembly representation of: - - 304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c509001 - -now shows as: - - 304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c5090[ALL] - -Note that the output of the RPC `decodescript` did not change because it is -configured specifically to process scriptPubKey and not scriptSig scripts. - ### Configuration and command-line options ### Block and transaction handling @@ -288,13 +50,3 @@ configured specifically to process scriptPubKey and not scriptSig scripts. ### Miscellaneous -- Removed bitrpc.py from contrib - -Addition of ZMQ-based Notifications -================================== - -Bitcoind can now (optionally) asynchronously notify clients through a -ZMQ-based PUB socket of the arrival of new transactions and blocks. -This feature requires installation of the ZMQ C API library 4.x and -configuring its use through the command line or configuration file. -Please see docs/zmq.md for details of operation. diff --git a/qa/pull-tester/rpc-tests.py b/qa/pull-tester/rpc-tests.py index df71e44b6037d..669c508ccd197 100755 --- a/qa/pull-tester/rpc-tests.py +++ b/qa/pull-tester/rpc-tests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -62,8 +62,10 @@ #Set env vars buildDir = BUILDDIR -os.environ["BITCOIND"] = buildDir + '/src/bitcoind' + EXEEXT -os.environ["BITCOINCLI"] = buildDir + '/src/bitcoin-cli' + EXEEXT +if "BITCOIND" not in os.environ: + os.environ["BITCOIND"] = buildDir + '/src/bitcoind' + EXEEXT +if "BITCOINCLI" not in os.environ: + os.environ["BITCOINCLI"] = buildDir + '/src/bitcoin-cli' + EXEEXT #Disable Windows tests by default if EXEEXT == ".exe" and "-win" not in opts: @@ -83,6 +85,7 @@ 'rest.py', 'mempool_spendcoinbase.py', 'mempool_reorg.py', + 'mempool_limit.py', 'httpbasics.py', 'multi_rpc.py', 'zapwallettxes.py', @@ -100,6 +103,8 @@ 'sendheaders.py', 'keypool.py', 'prioritise_transaction.py', + 'invalidblockrequest.py', + 'invalidtxrequest.py', ] testScriptsExt = [ 'bip65-cltv.py', @@ -116,7 +121,6 @@ # 'rpcbind_test.py', #temporary, bug in libevent, see #6655 'smartfees.py', 'maxblocksinflight.py', - 'invalidblockrequest.py', 'p2p-acceptblock.py', 'mempool_packages.py', 'maxuploadtarget.py', diff --git a/qa/rpc-tests/README.md b/qa/rpc-tests/README.md index 898931936b448..651b01f18a471 100644 --- a/qa/rpc-tests/README.md +++ b/qa/rpc-tests/README.md @@ -47,10 +47,7 @@ implements the test logic. * ```NodeConn``` is the class used to connect to a bitcoind. If you implement a callback class that derives from ```NodeConnCB``` and pass that to the ```NodeConn``` object, your code will receive the appropriate callbacks when -events of interest arrive. NOTE: be sure to call -```self.create_callback_map()``` in your derived classes' ```__init__``` -function, so that the correct mappings are set up between p2p messages and your -callback functions. +events of interest arrive. * You can pass the same handler to multiple ```NodeConn```'s if you like, or pass different ones to each -- whatever makes the most sense for your test. diff --git a/qa/rpc-tests/bip65-cltv-p2p.py b/qa/rpc-tests/bip65-cltv-p2p.py index 9ca5c69f162d2..5bb41df1ad5ed 100755 --- a/qa/rpc-tests/bip65-cltv-p2p.py +++ b/qa/rpc-tests/bip65-cltv-p2p.py @@ -9,7 +9,7 @@ from test_framework.mininode import CTransaction, NetworkThread from test_framework.blocktools import create_coinbase, create_block from test_framework.comptool import TestInstance, TestManager -from test_framework.script import CScript, OP_1NEGATE, OP_NOP2, OP_DROP +from test_framework.script import CScript, OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP from binascii import hexlify, unhexlify import cStringIO import time @@ -19,7 +19,7 @@ def cltv_invalidate(tx): Prepends -1 CLTV DROP in the scriptSig itself. ''' - tx.vin[0].scriptSig = CScript([OP_1NEGATE, OP_NOP2, OP_DROP] + + tx.vin[0].scriptSig = CScript([OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP] + list(CScript(tx.vin[0].scriptSig))) ''' diff --git a/qa/rpc-tests/bipdersig.py b/qa/rpc-tests/bipdersig.py index 243f816f65264..5afc9ddde8cc5 100755 --- a/qa/rpc-tests/bipdersig.py +++ b/qa/rpc-tests/bipdersig.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/blockchain.py b/qa/rpc-tests/blockchain.py index b7bfe362855ca..673f1cc545a6a 100755 --- a/qa/rpc-tests/blockchain.py +++ b/qa/rpc-tests/blockchain.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/decodescript.py b/qa/rpc-tests/decodescript.py index 4bca623380469..490808d49dd53 100755 --- a/qa/rpc-tests/decodescript.py +++ b/qa/rpc-tests/decodescript.py @@ -102,13 +102,13 @@ def decodescript_script_pub_key(self): # OP_IF # OP_CHECKSIGVERIFY # OP_ELSE - # OP_NOP2 OP_DROP + # OP_CHECKLOCKTIMEVERIFY OP_DROP # OP_ENDIF # OP_CHECKSIG # # lock until block 500,000 rpc_result = self.nodes[0].decodescript('63' + push_public_key + 'ad670320a107b17568' + push_public_key + 'ac') - assert_equal('OP_IF ' + public_key + ' OP_CHECKSIGVERIFY OP_ELSE 500000 OP_NOP2 OP_DROP OP_ENDIF ' + public_key + ' OP_CHECKSIG', rpc_result['asm']) + assert_equal('OP_IF ' + public_key + ' OP_CHECKSIGVERIFY OP_ELSE 500000 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_ENDIF ' + public_key + ' OP_CHECKSIG', rpc_result['asm']) def decoderawtransaction_asm_sighashtype(self): """Tests decoding scripts via RPC command "decoderawtransaction". diff --git a/qa/rpc-tests/disablewallet.py b/qa/rpc-tests/disablewallet.py index 4cb01575e2805..2112097af125f 100755 --- a/qa/rpc-tests/disablewallet.py +++ b/qa/rpc-tests/disablewallet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/forknotify.py b/qa/rpc-tests/forknotify.py index 0acef8e30b650..2deede0c380ff 100755 --- a/qa/rpc-tests/forknotify.py +++ b/qa/rpc-tests/forknotify.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py index 93d13faa06d3c..d6493dbb8a8fb 100755 --- a/qa/rpc-tests/fundrawtransaction.py +++ b/qa/rpc-tests/fundrawtransaction.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/getblocktemplate_longpoll.py b/qa/rpc-tests/getblocktemplate_longpoll.py index 1ddff8a2982e4..3e85957ae2323 100755 --- a/qa/rpc-tests/getblocktemplate_longpoll.py +++ b/qa/rpc-tests/getblocktemplate_longpoll.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/getblocktemplate_proposals.py b/qa/rpc-tests/getblocktemplate_proposals.py index aca0cd7495d28..f83b5f140d90b 100755 --- a/qa/rpc-tests/getblocktemplate_proposals.py +++ b/qa/rpc-tests/getblocktemplate_proposals.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/getchaintips.py b/qa/rpc-tests/getchaintips.py index 6a2bcb2969731..e8d2d8f3fdcfc 100755 --- a/qa/rpc-tests/getchaintips.py +++ b/qa/rpc-tests/getchaintips.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/httpbasics.py b/qa/rpc-tests/httpbasics.py index 7888114c54df4..5b9fa0097644c 100755 --- a/qa/rpc-tests/httpbasics.py +++ b/qa/rpc-tests/httpbasics.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/invalidateblock.py b/qa/rpc-tests/invalidateblock.py index 2b9c8154e0384..0e78a3c806f84 100755 --- a/qa/rpc-tests/invalidateblock.py +++ b/qa/rpc-tests/invalidateblock.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/invalidblockrequest.py b/qa/rpc-tests/invalidblockrequest.py index 6a7980cd45a52..a74ecb1288ba2 100755 --- a/qa/rpc-tests/invalidblockrequest.py +++ b/qa/rpc-tests/invalidblockrequest.py @@ -6,7 +6,7 @@ from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * -from test_framework.comptool import TestManager, TestInstance +from test_framework.comptool import TestManager, TestInstance, RejectResult from test_framework.mininode import * from test_framework.blocktools import * import logging @@ -97,7 +97,7 @@ def get_tests(self): assert(block2_orig.vtx != block2.vtx) self.tip = block2.sha256 - yield TestInstance([[block2, False], [block2_orig, True]]) + yield TestInstance([[block2, RejectResult(16,'bad-txns-duplicate')], [block2_orig, True]]) height += 1 ''' @@ -112,7 +112,7 @@ def get_tests(self): block3.rehash() block3.solve() - yield TestInstance([[block3, False]]) + yield TestInstance([[block3, RejectResult(16,'bad-cb-amount')]]) if __name__ == '__main__': diff --git a/qa/rpc-tests/invalidtxrequest.py b/qa/rpc-tests/invalidtxrequest.py new file mode 100755 index 0000000000000..d17b3d0980b50 --- /dev/null +++ b/qa/rpc-tests/invalidtxrequest.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python2 +# +# Distributed under the MIT/X11 software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +# + +from test_framework.test_framework import ComparisonTestFramework +from test_framework.util import * +from test_framework.comptool import TestManager, TestInstance, RejectResult +from test_framework.mininode import * +from test_framework.blocktools import * +import logging +import copy +import time + + +''' +In this test we connect to one node over p2p, and test tx requests. +''' + +# Use the ComparisonTestFramework with 1 node: only use --testbinary. +class InvalidTxRequestTest(ComparisonTestFramework): + + ''' Can either run this test as 1 node with expected answers, or two and compare them. + Change the "outcome" variable from each TestInstance object to only do the comparison. ''' + def __init__(self): + self.num_nodes = 1 + + def run_test(self): + test = TestManager(self, self.options.tmpdir) + test.add_all_connections(self.nodes) + self.tip = None + self.block_time = None + NetworkThread().start() # Start up network handling in another thread + test.run() + + def get_tests(self): + if self.tip is None: + self.tip = int ("0x" + self.nodes[0].getbestblockhash() + "L", 0) + self.block_time = int(time.time())+1 + + ''' + Create a new block with an anyone-can-spend coinbase + ''' + height = 1 + block = create_block(self.tip, create_coinbase(height), self.block_time) + self.block_time += 1 + block.solve() + # Save the coinbase for later + self.block1 = block + self.tip = block.sha256 + height += 1 + yield TestInstance([[block, True]]) + + ''' + Now we need that block to mature so we can spend the coinbase. + ''' + test = TestInstance(sync_every_block=False) + for i in xrange(100): + block = create_block(self.tip, create_coinbase(height), self.block_time) + block.solve() + self.tip = block.sha256 + self.block_time += 1 + test.blocks_and_transactions.append([block, True]) + height += 1 + yield test + + # chr(100) is OP_NOTIF + # Transaction will be rejected with code 16 (REJECT_INVALID) + tx1 = create_transaction(self.block1.vtx[0], 0, chr(100), 50*100000000) + yield TestInstance([[tx1, RejectResult(16, 'mandatory-script-verify-flag-failed')]]) + + # TODO: test further transactions... + +if __name__ == '__main__': + InvalidTxRequestTest().main() diff --git a/qa/rpc-tests/keypool.py b/qa/rpc-tests/keypool.py index 92d91e029ac67..c300bbc57e582 100755 --- a/qa/rpc-tests/keypool.py +++ b/qa/rpc-tests/keypool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index b30a6bc9d1c6d..8a1e3dc4bc93e 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/maxblocksinflight.py b/qa/rpc-tests/maxblocksinflight.py index a601147ce832f..1a9ae480abffd 100755 --- a/qa/rpc-tests/maxblocksinflight.py +++ b/qa/rpc-tests/maxblocksinflight.py @@ -34,7 +34,6 @@ def on_close(self, conn): def __init__(self): NodeConnCB.__init__(self) self.log = logging.getLogger("BlockRelayTest") - self.create_callback_map() def add_new_connection(self, connection): self.connection = connection diff --git a/qa/rpc-tests/maxuploadtarget.py b/qa/rpc-tests/maxuploadtarget.py index e714465db16d2..4d6b343f77d18 100755 --- a/qa/rpc-tests/maxuploadtarget.py +++ b/qa/rpc-tests/maxuploadtarget.py @@ -25,7 +25,6 @@ class TestNode(NodeConnCB): def __init__(self): NodeConnCB.__init__(self) - self.create_callback_map() self.connection = None self.ping_counter = 1 self.last_pong = msg_pong() @@ -85,22 +84,7 @@ def received_pong(): class MaxUploadTest(BitcoinTestFramework): def __init__(self): self.utxo = [] - - # Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create - # So we have big transactions and full blocks to fill up our block files - # create one script_pubkey - script_pubkey = "6a4d0200" #OP_RETURN OP_PUSH2 512 bytes - for i in xrange (512): - script_pubkey = script_pubkey + "01" - # concatenate 128 txouts of above script_pubkey which we'll insert before the txout for change - self.txouts = "81" - for k in xrange(128): - # add txout value - self.txouts = self.txouts + "0000000000000000" - # add length of script_pubkey - self.txouts = self.txouts + "fd0402" - # add script_pubkey - self.txouts = self.txouts + script_pubkey + self.txouts = gen_return_txouts() def add_options(self, parser): parser.add_option("--testbinary", dest="testbinary", diff --git a/qa/rpc-tests/mempool_limit.py b/qa/rpc-tests/mempool_limit.py new file mode 100755 index 0000000000000..3ba17ac4f1c73 --- /dev/null +++ b/qa/rpc-tests/mempool_limit.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python2 +# Copyright (c) 2014-2015 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# Test mempool limiting together/eviction with the wallet + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import * + +class MempoolLimitTest(BitcoinTestFramework): + + def __init__(self): + self.txouts = gen_return_txouts() + + def setup_network(self): + self.nodes = [] + self.nodes.append(start_node(0, self.options.tmpdir, ["-maxmempool=5", "-spendzeroconfchange=0", "-debug"])) + self.is_network_split = False + self.sync_all() + self.relayfee = self.nodes[0].getnetworkinfo()['relayfee'] + + def setup_chain(self): + print("Initializing test directory "+self.options.tmpdir) + initialize_chain_clean(self.options.tmpdir, 2) + + def run_test(self): + txids = [] + utxos = create_confirmed_utxos(self.relayfee, self.nodes[0], 90) + + #create a mempool tx that will be evicted + us0 = utxos.pop() + inputs = [{ "txid" : us0["txid"], "vout" : us0["vout"]}] + outputs = {self.nodes[0].getnewaddress() : 0.0001} + tx = self.nodes[0].createrawtransaction(inputs, outputs) + txF = self.nodes[0].fundrawtransaction(tx) + txFS = self.nodes[0].signrawtransaction(txF['hex']) + txid = self.nodes[0].sendrawtransaction(txFS['hex']) + self.nodes[0].lockunspent(True, [us0]) + + relayfee = self.nodes[0].getnetworkinfo()['relayfee'] + base_fee = relayfee*100 + for i in xrange (4): + txids.append([]) + txids[i] = create_lots_of_big_transactions(self.nodes[0], self.txouts, utxos[30*i:30*i+30], (i+1)*base_fee) + + # by now, the tx should be evicted, check confirmation state + assert(txid not in self.nodes[0].getrawmempool()) + txdata = self.nodes[0].gettransaction(txid); + assert(txdata['confirmations'] == 0) #confirmation should still be 0 + +if __name__ == '__main__': + MempoolLimitTest().main() diff --git a/qa/rpc-tests/mempool_packages.py b/qa/rpc-tests/mempool_packages.py index 34b316a6a32e9..063308d39430e 100755 --- a/qa/rpc-tests/mempool_packages.py +++ b/qa/rpc-tests/mempool_packages.py @@ -64,17 +64,41 @@ def run_test(self): for x in reversed(chain): assert_equal(mempool[x]['descendantcount'], descendant_count) descendant_fees += mempool[x]['fee'] + assert_equal(mempool[x]['modifiedfee'], mempool[x]['fee']) assert_equal(mempool[x]['descendantfees'], SATOSHIS*descendant_fees) descendant_size += mempool[x]['size'] assert_equal(mempool[x]['descendantsize'], descendant_size) descendant_count += 1 + # Check that descendant modified fees includes fee deltas from + # prioritisetransaction + self.nodes[0].prioritisetransaction(chain[-1], 0, 1000) + mempool = self.nodes[0].getrawmempool(True) + + descendant_fees = 0 + for x in reversed(chain): + descendant_fees += mempool[x]['fee'] + assert_equal(mempool[x]['descendantfees'], SATOSHIS*descendant_fees+1000) + # Adding one more transaction on to the chain should fail. try: self.chain_transaction(self.nodes[0], txid, vout, value, fee, 1) except JSONRPCException as e: print "too-long-ancestor-chain successfully rejected" + # Check that prioritising a tx before it's added to the mempool works + self.nodes[0].generate(1) + self.nodes[0].prioritisetransaction(chain[-1], 0, 2000) + self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash()) + mempool = self.nodes[0].getrawmempool(True) + + descendant_fees = 0 + for x in reversed(chain): + descendant_fees += mempool[x]['fee'] + if (x == chain[-1]): + assert_equal(mempool[x]['modifiedfee'], mempool[x]['fee']+satoshi_round(0.00002)) + assert_equal(mempool[x]['descendantfees'], SATOSHIS*descendant_fees+2000) + # TODO: check that node1's mempool is as expected # TODO: test ancestor size limits diff --git a/qa/rpc-tests/mempool_reorg.py b/qa/rpc-tests/mempool_reorg.py index fdbaf689ad5b2..d96a3f8266434 100755 --- a/qa/rpc-tests/mempool_reorg.py +++ b/qa/rpc-tests/mempool_reorg.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/mempool_resurrect_test.py b/qa/rpc-tests/mempool_resurrect_test.py index 19c74bb751409..750953ee5e70a 100755 --- a/qa/rpc-tests/mempool_resurrect_test.py +++ b/qa/rpc-tests/mempool_resurrect_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/mempool_spendcoinbase.py b/qa/rpc-tests/mempool_spendcoinbase.py index fc17c50692fb4..35ce76e24415c 100755 --- a/qa/rpc-tests/mempool_spendcoinbase.py +++ b/qa/rpc-tests/mempool_spendcoinbase.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/merkle_blocks.py b/qa/rpc-tests/merkle_blocks.py index 72a80ce6ca5fc..08e5db45fa631 100755 --- a/qa/rpc-tests/merkle_blocks.py +++ b/qa/rpc-tests/merkle_blocks.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/nodehandling.py b/qa/rpc-tests/nodehandling.py index e383a3a12c375..3239dd0339718 100755 --- a/qa/rpc-tests/nodehandling.py +++ b/qa/rpc-tests/nodehandling.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/p2p-acceptblock.py b/qa/rpc-tests/p2p-acceptblock.py index 700deab207152..23872d8494a7c 100755 --- a/qa/rpc-tests/p2p-acceptblock.py +++ b/qa/rpc-tests/p2p-acceptblock.py @@ -62,7 +62,6 @@ class TestNode(NodeConnCB): def __init__(self): NodeConnCB.__init__(self) - self.create_callback_map() self.connection = None self.ping_counter = 1 self.last_pong = msg_pong() diff --git a/qa/rpc-tests/p2p-fullblocktest.py b/qa/rpc-tests/p2p-fullblocktest.py index 9555940cece5e..a6525e679383b 100755 --- a/qa/rpc-tests/p2p-fullblocktest.py +++ b/qa/rpc-tests/p2p-fullblocktest.py @@ -7,7 +7,7 @@ from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * -from test_framework.comptool import TestManager, TestInstance +from test_framework.comptool import TestManager, TestInstance, RejectResult from test_framework.mininode import * from test_framework.blocktools import * import logging @@ -15,7 +15,7 @@ import time import numbers from test_framework.key import CECKey -from test_framework.script import CScript, CScriptOp, SignatureHash, SIGHASH_ALL, OP_TRUE +from test_framework.script import CScript, CScriptOp, SignatureHash, SIGHASH_ALL, OP_TRUE, OP_FALSE class PreviousSpendableOutput(object): def __init__(self, tx = CTransaction(), n = -1): @@ -122,13 +122,29 @@ def accepted(): return TestInstance([[self.tip, True]]) # returns a test case that asserts that the current tip was rejected - def rejected(): - return TestInstance([[self.tip, False]]) + def rejected(reject = None): + if reject is None: + return TestInstance([[self.tip, False]]) + else: + return TestInstance([[self.tip, reject]]) # move the tip back to a previous block def tip(number): self.tip = self.blocks[number] + # add transactions to a block produced by next_block + def update_block(block_number, new_transactions): + block = self.blocks[block_number] + old_hash = block.sha256 + self.add_transactions_to_block(block, new_transactions) + block.solve() + # Update the internal state just like in next_block + self.tip = block + self.block_heights[block.sha256] = self.block_heights[old_hash] + del self.block_heights[old_hash] + self.blocks[block_number] = block + return block + # creates a new block and advances the tip to that block block = self.next_block @@ -141,14 +157,15 @@ def tip(number): # Now we need that block to mature so we can spend the coinbase. test = TestInstance(sync_every_block=False) - for i in range(100): + for i in range(99): block(1000 + i) test.blocks_and_transactions.append([self.tip, True]) save_spendable_output() yield test - # Start by bulding a couple of blocks on top (which output is spent is in parentheses): + # Start by building a couple of blocks on top (which output is spent is + # in parentheses): # genesis -> b1 (0) -> b2 (1) out0 = get_spendable_output() block(1, spend=out0) @@ -156,8 +173,7 @@ def tip(number): yield accepted() out1 = get_spendable_output() - block(2, spend=out1) - # Inv again, then deliver twice (shouldn't break anything). + b2 = block(2, spend=out1) yield accepted() @@ -168,8 +184,8 @@ def tip(number): # # Nothing should happen at this point. We saw b2 first so it takes priority. tip(1) - block(3, spend=out1) - # Deliver twice (should still not break anything) + b3 = block(3, spend=out1) + txout_b3 = PreviousSpendableOutput(b3.vtx[1], 1) yield rejected() @@ -214,7 +230,7 @@ def tip(number): # \-> b3 (1) -> b4 (2) tip(6) block(9, spend=out4, additional_coinbase_value=1) - yield rejected() + yield rejected(RejectResult(16, 'bad-cb-amount')) # Create a fork that ends in a block with too much fee (the one that causes the reorg) @@ -226,7 +242,7 @@ def tip(number): yield rejected() block(11, spend=out4, additional_coinbase_value=1) - yield rejected() + yield rejected(RejectResult(16, 'bad-cb-amount')) # Try again, but with a valid fork first @@ -252,6 +268,10 @@ def tip(number): yield TestInstance([[b12, True, b13.sha256]]) # New tip should be b13. + # Add a block with MAX_BLOCK_SIGOPS and one with one more sigop + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) -> b16 (6) + # \-> b3 (1) -> b4 (2) # Test that a block with a lot of checksigs is okay lots_of_checksigs = CScript([OP_CHECKSIG] * (1000000 / 50 - 1)) @@ -264,8 +284,121 @@ def tip(number): out6 = get_spendable_output() too_many_checksigs = CScript([OP_CHECKSIG] * (1000000 / 50)) block(16, spend=out6, script=too_many_checksigs) + yield rejected(RejectResult(16, 'bad-blk-sigops')) + + + # Attempt to spend a transaction created on a different fork + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) -> b17 (b3.vtx[1]) + # \-> b3 (1) -> b4 (2) + tip(15) + block(17, spend=txout_b3) + yield rejected(RejectResult(16, 'bad-txns-inputs-missingorspent')) + + # Attempt to spend a transaction created on a different fork (on a fork this time) + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) + # \-> b18 (b3.vtx[1]) -> b19 (6) + # \-> b3 (1) -> b4 (2) + tip(13) + block(18, spend=txout_b3) + yield rejected() + + block(19, spend=out6) yield rejected() + # Attempt to spend a coinbase at depth too low + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) -> b20 (7) + # \-> b3 (1) -> b4 (2) + tip(15) + out7 = get_spendable_output() + block(20, spend=out7) + yield rejected(RejectResult(16, 'bad-txns-premature-spend-of-coinbase')) + + # Attempt to spend a coinbase at depth too low (on a fork this time) + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) + # \-> b21 (6) -> b22 (5) + # \-> b3 (1) -> b4 (2) + tip(13) + block(21, spend=out6) + yield rejected() + + block(22, spend=out5) + yield rejected() + + # Create a block on either side of MAX_BLOCK_SIZE and make sure its accepted/rejected + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) -> b23 (6) + # \-> b24 (6) -> b25 (7) + # \-> b3 (1) -> b4 (2) + tip(15) + b23 = block(23, spend=out6) + old_hash = b23.sha256 + tx = CTransaction() + script_length = MAX_BLOCK_SIZE - len(b23.serialize()) - 69 + script_output = CScript([chr(0)*script_length]) + tx.vout.append(CTxOut(0, script_output)) + tx.vin.append(CTxIn(COutPoint(b23.vtx[1].sha256, 1))) + b23 = update_block(23, [tx]) + # Make sure the math above worked out to produce a max-sized block + assert_equal(len(b23.serialize()), MAX_BLOCK_SIZE) + yield accepted() + + # Make the next block one byte bigger and check that it fails + tip(15) + b24 = block(24, spend=out6) + script_length = MAX_BLOCK_SIZE - len(b24.serialize()) - 69 + script_output = CScript([chr(0)*(script_length+1)]) + tx.vout = [CTxOut(0, script_output)] + b24 = update_block(24, [tx]) + assert_equal(len(b24.serialize()), MAX_BLOCK_SIZE+1) + yield rejected(RejectResult(16, 'bad-blk-length')) + + b25 = block(25, spend=out7) + yield rejected() + + # Create blocks with a coinbase input script size out of range + # genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3) + # \-> b12 (3) -> b13 (4) -> b15 (5) -> b23 (6) -> b30 (7) + # \-> ... (6) -> ... (7) + # \-> b3 (1) -> b4 (2) + tip(15) + b26 = block(26, spend=out6) + b26.vtx[0].vin[0].scriptSig = chr(0) + b26.vtx[0].rehash() + # update_block causes the merkle root to get updated, even with no new + # transactions, and updates the required state. + b26 = update_block(26, []) + yield rejected(RejectResult(16, 'bad-cb-length')) + + # Extend the b26 chain to make sure bitcoind isn't accepting b26 + b27 = block(27, spend=out7) + yield rejected() + + # Now try a too-large-coinbase script + tip(15) + b28 = block(28, spend=out6) + b28.vtx[0].vin[0].scriptSig = chr(0)*101 + b28.vtx[0].rehash() + b28 = update_block(28, []) + yield rejected(RejectResult(16, 'bad-cb-length')) + + # Extend the b28 chain to make sure bitcoind isn't accepted b28 + b29 = block(29, spend=out7) + # TODO: Should get a reject message back with "bad-prevblk", except + # there's a bug that prevents this from being detected. Just note + # failure for now, and add the reject result later. + yield rejected() + + # b30 has a max-sized coinbase scriptSig. + tip(23) + b30 = block(30) + b30.vtx[0].vin[0].scriptSig = chr(0)*100 + b30.vtx[0].rehash() + b30 = update_block(30, []) + yield accepted() if __name__ == '__main__': diff --git a/qa/rpc-tests/prioritise_transaction.py b/qa/rpc-tests/prioritise_transaction.py index f376ceee5ecb6..4a79d38da0e7d 100755 --- a/qa/rpc-tests/prioritise_transaction.py +++ b/qa/rpc-tests/prioritise_transaction.py @@ -15,21 +15,7 @@ class PrioritiseTransactionTest(BitcoinTestFramework): def __init__(self): - # Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create - # So we have big transactions (and therefore can't fit very many into each block) - # create one script_pubkey - script_pubkey = "6a4d0200" #OP_RETURN OP_PUSH2 512 bytes - for i in xrange (512): - script_pubkey = script_pubkey + "01" - # concatenate 128 txouts of above script_pubkey which we'll insert before the txout for change - self.txouts = "81" - for k in xrange(128): - # add txout value - self.txouts = self.txouts + "0000000000000000" - # add length of script_pubkey - self.txouts = self.txouts + "fd0402" - # add script_pubkey - self.txouts = self.txouts + script_pubkey + self.txouts = gen_return_txouts() def setup_chain(self): print("Initializing test directory "+self.options.tmpdir) @@ -42,62 +28,15 @@ def setup_network(self): self.nodes.append(start_node(0, self.options.tmpdir, ["-debug", "-printpriority=1"])) self.relayfee = self.nodes[0].getnetworkinfo()['relayfee'] - def create_confirmed_utxos(self, count): - self.nodes[0].generate(int(0.5*count)+101) - utxos = self.nodes[0].listunspent() - iterations = count - len(utxos) - addr1 = self.nodes[0].getnewaddress() - addr2 = self.nodes[0].getnewaddress() - if iterations <= 0: - return utxos - for i in xrange(iterations): - t = utxos.pop() - fee = self.relayfee - inputs = [] - inputs.append({ "txid" : t["txid"], "vout" : t["vout"]}) - outputs = {} - send_value = t['amount'] - fee - outputs[addr1] = satoshi_round(send_value/2) - outputs[addr2] = satoshi_round(send_value/2) - raw_tx = self.nodes[0].createrawtransaction(inputs, outputs) - signed_tx = self.nodes[0].signrawtransaction(raw_tx)["hex"] - txid = self.nodes[0].sendrawtransaction(signed_tx) - - while (self.nodes[0].getmempoolinfo()['size'] > 0): - self.nodes[0].generate(1) - - utxos = self.nodes[0].listunspent() - assert(len(utxos) >= count) - return utxos - - def create_lots_of_big_transactions(self, utxos, fee): - addr = self.nodes[0].getnewaddress() - txids = [] - for i in xrange(len(utxos)): - t = utxos.pop() - inputs = [] - inputs.append({ "txid" : t["txid"], "vout" : t["vout"]}) - outputs = {} - send_value = t['amount'] - fee - outputs[addr] = satoshi_round(send_value) - rawtx = self.nodes[0].createrawtransaction(inputs, outputs) - newtx = rawtx[0:92] - newtx = newtx + self.txouts - newtx = newtx + rawtx[94:] - signresult = self.nodes[0].signrawtransaction(newtx, None, None, "NONE") - txid = self.nodes[0].sendrawtransaction(signresult["hex"], True) - txids.append(txid) - return txids - def run_test(self): - utxos = self.create_confirmed_utxos(90) + utxos = create_confirmed_utxos(self.relayfee, self.nodes[0], 90) base_fee = self.relayfee*100 # our transactions are smaller than 100kb txids = [] # Create 3 batches of transactions at 3 different fee rate levels for i in xrange(3): txids.append([]) - txids[i] = self.create_lots_of_big_transactions(utxos[30*i:30*i+30], (i+1)*base_fee) + txids[i] = create_lots_of_big_transactions(self.nodes[0], self.txouts, utxos[30*i:30*i+30], (i+1)*base_fee) # add a fee delta to something in the cheapest bucket and make sure it gets mined # also check that a different entry in the cheapest bucket is NOT mined (lower @@ -143,5 +82,45 @@ def run_test(self): if (x != high_fee_tx): assert(x not in mempool) + # Create a free, low priority transaction. Should be rejected. + utxo_list = self.nodes[0].listunspent() + assert(len(utxo_list) > 0) + utxo = utxo_list[0] + + inputs = [] + outputs = {} + inputs.append({"txid" : utxo["txid"], "vout" : utxo["vout"]}) + outputs[self.nodes[0].getnewaddress()] = utxo["amount"] - self.relayfee + raw_tx = self.nodes[0].createrawtransaction(inputs, outputs) + tx_hex = self.nodes[0].signrawtransaction(raw_tx)["hex"] + txid = self.nodes[0].sendrawtransaction(tx_hex) + + # A tx that spends an in-mempool tx has 0 priority, so we can use it to + # test the effect of using prioritise transaction for mempool acceptance + inputs = [] + inputs.append({"txid": txid, "vout": 0}) + outputs = {} + outputs[self.nodes[0].getnewaddress()] = utxo["amount"] - self.relayfee + raw_tx2 = self.nodes[0].createrawtransaction(inputs, outputs) + tx2_hex = self.nodes[0].signrawtransaction(raw_tx2)["hex"] + tx2_id = self.nodes[0].decoderawtransaction(tx2_hex)["txid"] + + try: + self.nodes[0].sendrawtransaction(tx2_hex) + except JSONRPCException as exp: + assert_equal(exp.error['code'], -26) # insufficient fee + assert(tx2_id not in self.nodes[0].getrawmempool()) + else: + assert(False) + + # This is a less than 1000-byte transaction, so just set the fee + # to be the minimum for a 1000 byte transaction and check that it is + # accepted. + self.nodes[0].prioritisetransaction(tx2_id, 0, int(self.relayfee*COIN)) + + print "Assert that prioritised free transaction is accepted to mempool" + assert_equal(self.nodes[0].sendrawtransaction(tx2_hex), tx2_id) + assert(tx2_id in self.nodes[0].getrawmempool()) + if __name__ == '__main__': PrioritiseTransactionTest().main() diff --git a/qa/rpc-tests/pruning.py b/qa/rpc-tests/pruning.py index 21f8d69382d02..26ae4af010490 100755 --- a/qa/rpc-tests/pruning.py +++ b/qa/rpc-tests/pruning.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -23,24 +23,7 @@ class PruneTest(BitcoinTestFramework): def __init__(self): self.utxo = [] self.address = ["",""] - - # Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create - # So we have big transactions and full blocks to fill up our block files - - # create one script_pubkey - script_pubkey = "6a4d0200" #OP_RETURN OP_PUSH2 512 bytes - for i in xrange (512): - script_pubkey = script_pubkey + "01" - # concatenate 128 txouts of above script_pubkey which we'll insert before the txout for change - self.txouts = "81" - for k in xrange(128): - # add txout value - self.txouts = self.txouts + "0000000000000000" - # add length of script_pubkey - self.txouts = self.txouts + "fd0402" - # add script_pubkey - self.txouts = self.txouts + script_pubkey - + self.txouts = gen_return_txouts() def setup_chain(self): print("Initializing test directory "+self.options.tmpdir) diff --git a/qa/rpc-tests/rawtransactions.py b/qa/rpc-tests/rawtransactions.py index 173faf736ec85..d77b41979b74d 100755 --- a/qa/rpc-tests/rawtransactions.py +++ b/qa/rpc-tests/rawtransactions.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/receivedby.py b/qa/rpc-tests/receivedby.py index 16d6bd4cf1cbc..18af0e8102417 100755 --- a/qa/rpc-tests/receivedby.py +++ b/qa/rpc-tests/receivedby.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/reindex.py b/qa/rpc-tests/reindex.py index f2e3f248ea5fa..d90177a029e4b 100755 --- a/qa/rpc-tests/reindex.py +++ b/qa/rpc-tests/reindex.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/replace-by-fee.py b/qa/rpc-tests/replace-by-fee.py index 6e9e0b304cec7..734db33b5125d 100755 --- a/qa/rpc-tests/replace-by-fee.py +++ b/qa/rpc-tests/replace-by-fee.py @@ -63,8 +63,14 @@ def make_utxo(node, amount, confirmed=True, scriptPubKey=CScript([1])): # If requested, ensure txouts are confirmed. if confirmed: - while len(node.getrawmempool()): + mempool_size = len(node.getrawmempool()) + while mempool_size > 0: node.generate(1) + new_size = len(node.getrawmempool()) + # Error out if we have something stuck in the mempool, as this + # would likely be a bug. + assert(new_size < mempool_size) + mempool_size = new_size return COutPoint(int(txid, 16), 0) @@ -72,7 +78,7 @@ class ReplaceByFeeTest(BitcoinTestFramework): def setup_network(self): self.nodes = [] - self.nodes.append(start_node(0, self.options.tmpdir, ["-maxorphantx=1000", + self.nodes.append(start_node(0, self.options.tmpdir, ["-maxorphantx=1000", "-debug", "-relaypriority=0", "-whitelist=127.0.0.1", "-limitancestorcount=50", "-limitancestorsize=101", @@ -108,6 +114,9 @@ def run_test(self): print "Running test opt-in..." self.test_opt_in() + print "Running test prioritised transactions..." + self.test_prioritised_transactions() + print "Passed\n" def test_simple_doublespend(self): @@ -513,5 +522,72 @@ def test_opt_in(self): # but make sure it is accepted anyway self.nodes[0].sendrawtransaction(tx3c_hex, True) + def test_prioritised_transactions(self): + # Ensure that fee deltas used via prioritisetransaction are + # correctly used by replacement logic + + # 1. Check that feeperkb uses modified fees + tx0_outpoint = make_utxo(self.nodes[0], 1.1*COIN) + + tx1a = CTransaction() + tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0)] + tx1a.vout = [CTxOut(1*COIN, CScript([b'a']))] + tx1a_hex = txToHex(tx1a) + tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True) + + # Higher fee, but the actual fee per KB is much lower. + tx1b = CTransaction() + tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)] + tx1b.vout = [CTxOut(0.001*COIN, CScript([b'a'*740000]))] + tx1b_hex = txToHex(tx1b) + + # Verify tx1b cannot replace tx1a. + try: + tx1b_txid = self.nodes[0].sendrawtransaction(tx1b_hex, True) + except JSONRPCException as exp: + assert_equal(exp.error['code'], -26) + else: + assert(False) + + # Use prioritisetransaction to set tx1a's fee to 0. + self.nodes[0].prioritisetransaction(tx1a_txid, 0, int(-0.1*COIN)) + + # Now tx1b should be able to replace tx1a + tx1b_txid = self.nodes[0].sendrawtransaction(tx1b_hex, True) + + assert(tx1b_txid in self.nodes[0].getrawmempool()) + + # 2. Check that absolute fee checks use modified fee. + tx1_outpoint = make_utxo(self.nodes[0], 1.1*COIN) + + tx2a = CTransaction() + tx2a.vin = [CTxIn(tx1_outpoint, nSequence=0)] + tx2a.vout = [CTxOut(1*COIN, CScript([b'a']))] + tx2a_hex = txToHex(tx2a) + tx2a_txid = self.nodes[0].sendrawtransaction(tx2a_hex, True) + + # Lower fee, but we'll prioritise it + tx2b = CTransaction() + tx2b.vin = [CTxIn(tx1_outpoint, nSequence=0)] + tx2b.vout = [CTxOut(1.01*COIN, CScript([b'a']))] + tx2b.rehash() + tx2b_hex = txToHex(tx2b) + + # Verify tx2b cannot replace tx2a. + try: + tx2b_txid = self.nodes[0].sendrawtransaction(tx2b_hex, True) + except JSONRPCException as exp: + assert_equal(exp.error['code'], -26) + else: + assert(False) + + # Now prioritise tx2b to have a higher modified fee + self.nodes[0].prioritisetransaction(tx2b.hash, 0, int(0.1*COIN)) + + # tx2b should now be accepted + tx2b_txid = self.nodes[0].sendrawtransaction(tx2b_hex, True) + + assert(tx2b_txid in self.nodes[0].getrawmempool()) + if __name__ == '__main__': ReplaceByFeeTest().main() diff --git a/qa/rpc-tests/rest.py b/qa/rpc-tests/rest.py index e084ad55abb4b..682c5316912b6 100755 --- a/qa/rpc-tests/rest.py +++ b/qa/rpc-tests/rest.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/rpcbind_test.py b/qa/rpc-tests/rpcbind_test.py index 7a9da667874b8..5f409ad616df3 100755 --- a/qa/rpc-tests/rpcbind_test.py +++ b/qa/rpc-tests/rpcbind_test.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/segwit.py b/qa/rpc-tests/segwit.py new file mode 100755 index 0000000000000..fda65c50b6573 --- /dev/null +++ b/qa/rpc-tests/segwit.py @@ -0,0 +1,269 @@ +#!/usr/bin/env python2 +# Copyright (c) 2014 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +# +# Test the SegWit changeover logic +# + +from test_framework.test_framework import BitcoinTestFramework +from test_framework.util import * +import os +import shutil +import hashlib +from binascii import hexlify + +NODE_0 = 0 +NODE_1 = 1 +NODE_2 = 2 +WIT_V0 = 0 +WIT_V1 = 1 + +def sha256(s): + return hashlib.new('sha256', s).digest() + +def ripemd160(s): + return hashlib.new('ripemd160', s).digest() + +def witness_script(version, pubkey): + if (version == 0): + pubkeyhash = hexlify(ripemd160(sha256(pubkey.decode("hex")))) + pkscript = "001976a914" + pubkeyhash + "88ac" + elif (version == 1): + witnessprogram = "21"+pubkey+"ac" + hashwitnessprogram = hexlify(sha256(witnessprogram.decode("hex"))) + pkscript = "5120" + hashwitnessprogram + else: + assert("Wrong version" == "0 or 1") + return pkscript + +def addlength(script): + scriptlen = format(len(script)/2, 'x') + assert(len(scriptlen) == 2) + return scriptlen + script + +def create_witnessprogram(version, node, utxo, pubkey, encode_p2sh, amount): + pkscript = witness_script(version, pubkey); + if (encode_p2sh): + p2sh_hash = hexlify(ripemd160(sha256(pkscript.decode("hex")))) + pkscript = "a914"+p2sh_hash+"87" + inputs = [] + outputs = {} + inputs.append({ "txid" : utxo["txid"], "vout" : utxo["vout"]} ) + DUMMY_P2SH = "2MySexEGVzZpRgNQ1JdjdP5bRETznm3roQ2" # P2SH of "OP_1 OP_DROP" + outputs[DUMMY_P2SH] = amount + tx_to_witness = node.createrawtransaction(inputs,outputs) + #replace dummy output with our own + tx_to_witness = tx_to_witness[0:110] + addlength(pkscript) + tx_to_witness[-8:] + return tx_to_witness + +def send_to_witness(version, node, utxo, pubkey, encode_p2sh, amount, sign=True, insert_redeem_script=""): + tx_to_witness = create_witnessprogram(version, node, utxo, pubkey, encode_p2sh, amount) + if (sign): + signed = node.signrawtransaction(tx_to_witness) + return node.sendrawtransaction(signed["hex"]) + else: + if (insert_redeem_script): + tx_to_witness = tx_to_witness[0:82] + addlength(insert_redeem_script) + tx_to_witness[84:] + + return node.sendrawtransaction(tx_to_witness) + +def getutxo(txid): + utxo = {} + utxo["vout"] = 0 + utxo["txid"] = txid + return utxo + +class SegWitTest(BitcoinTestFramework): + + def setup_chain(self): + print("Initializing test directory "+self.options.tmpdir) + initialize_chain_clean(self.options.tmpdir, 3) + + def setup_network(self): + self.nodes = [] + self.nodes.append(start_node(0, self.options.tmpdir, ["-logtimemicros", "-debug"])) + self.nodes.append(start_node(1, self.options.tmpdir, ["-logtimemicros", "-debug", "-blockversion=4", "-promiscuousmempoolflags=517", "-prematurewitness"])) + self.nodes.append(start_node(2, self.options.tmpdir, ["-logtimemicros", "-debug", "-blockversion=5", "-promiscuousmempoolflags=517", "-prematurewitness"])) + connect_nodes(self.nodes[1], 0) + connect_nodes(self.nodes[2], 1) + connect_nodes(self.nodes[0], 2) + self.is_network_split = False + self.sync_all() + + def success_mine(self, node, txid, sign, redeem_script=""): + send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal("49.998"), sign, redeem_script) + block = node.generate(1) + assert_equal(len(node.getblock(block[0])["tx"]), 2) + sync_blocks(self.nodes) + + def skip_mine(self, node, txid, sign, redeem_script=""): + send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal("49.998"), sign, redeem_script) + block = node.generate(1) + assert_equal(len(node.getblock(block[0])["tx"]), 1) + sync_blocks(self.nodes) + + def fail_accept(self, node, txid, sign, redeem_script=""): + try: + send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal("49.998"), sign, redeem_script) + except JSONRPCException as exp: + assert(exp.error["code"] == -26) + else: + raise AssertionError("Tx should not have been accepted") + + def fail_mine(self, node, txid, sign, redeem_script=""): + send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal("49.998"), sign, redeem_script) + try: + node.generate(1) + except JSONRPCException as exp: + assert(exp.error["code"] == -1) + else: + raise AssertionError("Created valid block when TestBlockValidity should have failed") + sync_blocks(self.nodes) + + def run_test(self): + self.nodes[0].generate(160) #block 160 + + self.pubkey = [] + 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 + 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 + for i in xrange(3): + newaddress = self.nodes[i].getnewaddress() + self.nodes[i].addwitnessaddress(newaddress) + self.pubkey.append(self.nodes[i].validateaddress(newaddress)["pubkey"]) + p2sh_ids.append([]) + wit_ids.append([]) + for v in xrange(2): + p2sh_ids[i].append([]) + wit_ids[i].append([]) + + for i in xrange(5): + for n in xrange(3): + for v in xrange(2): + wit_ids[n][v].append(send_to_witness(v, self.nodes[0], self.nodes[0].listunspent()[0], self.pubkey[n], False, Decimal("49.999"))) + p2sh_ids[n][v].append(send_to_witness(v, self.nodes[0], self.nodes[0].listunspent()[0], self.pubkey[n], True, Decimal("49.999"))) + + self.nodes[0].generate(1) #block 161 + sync_blocks(self.nodes) + + # Make sure all nodes recognize the transactions as theirs + assert_equal(self.nodes[0].getbalance(), 60*50 - 60*50 + 20*Decimal("49.999") + 50) + assert_equal(self.nodes[1].getbalance(), 20*Decimal("49.999")) + assert_equal(self.nodes[2].getbalance(), 20*Decimal("49.999")) + + self.nodes[0].generate(581) #block 742 + sync_blocks(self.nodes) + + print "Verify default node can't accept any witness format txs before fork" + # unsigned, no scriptsig + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V0][0], False) + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V1][0], False) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], False) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], False) + # unsigned with redeem script + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], False, addlength(witness_script(0, self.pubkey[0]))) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], False, addlength(witness_script(1, self.pubkey[0]))) + # signed + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V0][0], True) + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V1][0], True) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], True) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], True) + + print "Verify witness txs are skipped for mining before the fork" + self.skip_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][0], True) #block 743 + self.skip_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][0], True) #block 744 + self.skip_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][0], True) #block 745 + self.skip_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][0], True) #block 746 + + # TODO: An old node would see these txs without witnesses and be able to mine them + + print "Verify unsigned bare witness txs in version 5 blocks are valid before the fork" + self.success_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][1], False) #block 747 + self.success_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][1], False) #block 748 + + print "Verify unsigned p2sh witness txs without a redeem script are invalid" + self.fail_accept(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][1], False) + self.fail_accept(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][1], False) + + print "Verify unsigned p2sh witness txs with a redeem script in version 5 blocks are valid before the fork" + self.success_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][1], False, addlength(witness_script(0, self.pubkey[2]))) #block 749 + self.success_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][1], False, addlength(witness_script(1, self.pubkey[2]))) #block 750 + + print "Verify previous witness txs skipped for mining can now be mined" + assert_equal(len(self.nodes[2].getrawmempool()), 4) + block = self.nodes[2].generate(1) #block 751 + sync_blocks(self.nodes) + assert_equal(len(self.nodes[2].getrawmempool()), 0) + assert_equal(len(self.nodes[2].getblock(block[0])["tx"]), 5) + + print "Verify witness txs without witness data in version 5 blocks are invalid after the fork" + self.fail_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][2], False) + self.fail_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][2], False) + self.fail_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][2], False, addlength(witness_script(0, self.pubkey[2]))) + self.fail_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][2], False, addlength(witness_script(1, self.pubkey[2]))) + + + print "Verify that a version 4 block can still mine those unsigned txs" + assert_equal(len(self.nodes[2].getrawmempool()), 4) + sync_mempools(self.nodes[1:3]) + block = self.nodes[1].generate(1) #block 752 + sync_blocks(self.nodes) + assert_equal(len(self.nodes[2].getrawmempool()), 0) + assert_equal(len(self.nodes[1].getblock(block[0])["tx"]), 5) + + print "Verify all types of witness txs can be submitted signed after the fork to node with -prematurewitness" + self.success_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][3], True) #block 753 + self.success_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][3], True) #block 754 + self.success_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][3], True) #block 755 + self.success_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][3], True) #block 756 + + print "Verify default node can't accept any witness format txs between enforce and reject points of fork" + # unsigned, no scriptsig + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V0][0], False) + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V1][0], False) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], False) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], False) + # unsigned with redeem script + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], False, addlength(witness_script(0, self.pubkey[0]))) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], False, addlength(witness_script(1, self.pubkey[0]))) + # signed + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V0][0], True) + self.fail_accept(self.nodes[0], wit_ids[NODE_0][WIT_V1][0], True) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], True) + self.fail_accept(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], True) + + # TODO: verify witness txs are invalid if in a v4 block + print "Verify witness txs aren't mined in a v4 block" + self.skip_mine(self.nodes[1], wit_ids[NODE_1][WIT_V0][0], True) #block 757 + self.skip_mine(self.nodes[1], wit_ids[NODE_1][WIT_V1][0], True) #block 758 + self.skip_mine(self.nodes[1], p2sh_ids[NODE_1][WIT_V0][0], True) #block 759 + self.skip_mine(self.nodes[1], p2sh_ids[NODE_1][WIT_V1][0], True) #block 760 + + # Mine them from ver 5 node + sync_mempools(self.nodes[1:3]) + assert_equal(len(self.nodes[2].getrawmempool()), 4) + block = self.nodes[2].generate(1) #block 761 + sync_blocks(self.nodes) + assert_equal(len(self.nodes[2].getrawmempool()), 0) + assert_equal(len(self.nodes[2].getblock(block[0])["tx"]), 5) + + self.nodes[0].generate(195) #block 956 (5 of which are v4 blocks) + sync_blocks(self.nodes) + + print "Verify that version 4 blocks are invalid period after reject point" + try: + self.nodes[1].generate(1) + except JSONRPCException as exp: + assert(exp.error["code"] == -1) + else: + raise AssertionError("Created valid block when TestBlockValidity should have failed") + + print "Verify default node can now use witness txs" + self.success_mine(self.nodes[0], wit_ids[NODE_0][WIT_V0][0], True) #block 957 + self.success_mine(self.nodes[0], wit_ids[NODE_0][WIT_V1][0], True) #block 958 + self.success_mine(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], True) #block 959 + self.success_mine(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], True) #block 960 + +if __name__ == '__main__': + SegWitTest().main() diff --git a/qa/rpc-tests/sendheaders.py b/qa/rpc-tests/sendheaders.py index d7f4292090d01..e6e26dbce3c82 100755 --- a/qa/rpc-tests/sendheaders.py +++ b/qa/rpc-tests/sendheaders.py @@ -70,7 +70,6 @@ class BaseNode(NodeConnCB): def __init__(self): NodeConnCB.__init__(self) - self.create_callback_map() self.connection = None self.last_inv = None self.last_headers = None @@ -389,7 +388,7 @@ def run_test(self): # Use getblocks/getdata test_node.send_getblocks(locator = [fork_point]) - assert_equal(test_node.check_last_announcement(inv=new_block_hashes[0:-1]), True) + assert_equal(test_node.check_last_announcement(inv=new_block_hashes), True) test_node.get_data(new_block_hashes) test_node.wait_for_block(new_block_hashes[-1]) diff --git a/qa/rpc-tests/test_framework/comptool.py b/qa/rpc-tests/test_framework/comptool.py index e0b3ce040d84e..badbc0a1fbcde 100755 --- a/qa/rpc-tests/test_framework/comptool.py +++ b/qa/rpc-tests/test_framework/comptool.py @@ -41,17 +41,32 @@ def wait_until(predicate, attempts=float('inf'), timeout=float('inf')): return False +class RejectResult(object): + ''' + Outcome that expects rejection of a transaction or block. + ''' + def __init__(self, code, reason=''): + self.code = code + self.reason = reason + def match(self, other): + if self.code != other.code: + return False + return other.reason.startswith(self.reason) + def __repr__(self): + return '%i:%s' % (self.code,self.reason or '*') + class TestNode(NodeConnCB): def __init__(self, block_store, tx_store): NodeConnCB.__init__(self) - self.create_callback_map() self.conn = None self.bestblockhash = None self.block_store = block_store self.block_request_map = {} self.tx_store = tx_store self.tx_request_map = {} + self.block_reject_map = {} + self.tx_reject_map = {} # When the pingmap is non-empty we're waiting for # a response @@ -95,6 +110,12 @@ def on_pong(self, conn, message): except KeyError: raise AssertionError("Got pong for unknown ping [%s]" % repr(message)) + def on_reject(self, conn, message): + if message.message == 'tx': + self.tx_reject_map[message.data] = RejectResult(message.code, message.reason) + if message.message == 'block': + self.block_reject_map[message.data] = RejectResult(message.code, message.reason) + def send_inv(self, obj): mtype = 2 if isinstance(obj, CBlock) else 1 self.conn.send_message(msg_inv([CInv(mtype, obj.sha256)])) @@ -244,6 +265,15 @@ def check_results(self, blockhash, outcome): if outcome is None: if c.cb.bestblockhash != self.connections[0].cb.bestblockhash: return False + elif isinstance(outcome, RejectResult): # Check that block was rejected w/ code + if c.cb.bestblockhash == blockhash: + return False + if blockhash not in c.cb.block_reject_map: + print 'Block not in reject map: %064x' % (blockhash) + return False + if not outcome.match(c.cb.block_reject_map[blockhash]): + print 'Block rejected with %s instead of expected %s: %064x' % (c.cb.block_reject_map[blockhash], outcome, blockhash) + return False elif ((c.cb.bestblockhash == blockhash) != outcome): # print c.cb.bestblockhash, blockhash, outcome return False @@ -263,6 +293,15 @@ def check_mempool(self, txhash, outcome): if c.cb.lastInv != self.connections[0].cb.lastInv: # print c.rpc.getrawmempool() return False + elif isinstance(outcome, RejectResult): # Check that tx was rejected w/ code + if txhash in c.cb.lastInv: + return False + if txhash not in c.cb.tx_reject_map: + print 'Tx not in reject map: %064x' % (txhash) + return False + if not outcome.match(c.cb.tx_reject_map[txhash]): + print 'Tx rejected with %s instead of expected %s: %064x' % (c.cb.tx_reject_map[txhash], outcome, txhash) + return False elif ((txhash in c.cb.lastInv) != outcome): # print c.rpc.getrawmempool(), c.cb.lastInv return False diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py index 64985d58e2f56..8e49b5656563f 100755 --- a/qa/rpc-tests/test_framework/mininode.py +++ b/qa/rpc-tests/test_framework/mininode.py @@ -36,6 +36,7 @@ MY_SUBVERSION = "/python-mininode-tester:0.0.1/" MAX_INV_SZ = 50000 +MAX_BLOCK_SIZE = 1000000 # Keep our own socket map for asyncore, so that we can track disconnects # ourselves (to workaround an issue with closing an asyncore socket when @@ -1015,32 +1016,10 @@ def wait_for_verack(self): return time.sleep(0.05) - # Derived classes should call this function once to set the message map - # which associates the derived classes' functions to incoming messages - def create_callback_map(self): - self.cbmap = { - "version": self.on_version, - "verack": self.on_verack, - "addr": self.on_addr, - "alert": self.on_alert, - "inv": self.on_inv, - "getdata": self.on_getdata, - "getblocks": self.on_getblocks, - "tx": self.on_tx, - "block": self.on_block, - "getaddr": self.on_getaddr, - "ping": self.on_ping, - "pong": self.on_pong, - "headers": self.on_headers, - "getheaders": self.on_getheaders, - "reject": self.on_reject, - "mempool": self.on_mempool - } - def deliver(self, conn, message): with mininode_lock: try: - self.cbmap[message.command](conn, message) + getattr(self, 'on_' + message.command)(conn, message) except: print "ERROR delivering %s (%s)" % (repr(message), sys.exc_info()[0]) diff --git a/qa/rpc-tests/test_framework/netutil.py b/qa/rpc-tests/test_framework/netutil.py index b30a88a4f783a..50daa8793732a 100644 --- a/qa/rpc-tests/test_framework/netutil.py +++ b/qa/rpc-tests/test_framework/netutil.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/test_framework/script.py b/qa/rpc-tests/test_framework/script.py index 0a78cf6fb1b3c..0088876028f51 100644 --- a/qa/rpc-tests/test_framework/script.py +++ b/qa/rpc-tests/test_framework/script.py @@ -226,7 +226,7 @@ def __new__(cls, n): # expansion OP_NOP1 = CScriptOp(0xb0) -OP_NOP2 = CScriptOp(0xb1) +OP_CHECKLOCKTIMEVERIFY = CScriptOp(0xb1) OP_NOP3 = CScriptOp(0xb2) OP_NOP4 = CScriptOp(0xb3) OP_NOP5 = CScriptOp(0xb4) @@ -353,7 +353,7 @@ def __new__(cls, n): OP_CHECKMULTISIGVERIFY, OP_NOP1, - OP_NOP2, + OP_CHECKLOCKTIMEVERIFY, OP_NOP3, OP_NOP4, OP_NOP5, @@ -472,7 +472,7 @@ def __new__(cls, n): OP_CHECKMULTISIG : 'OP_CHECKMULTISIG', OP_CHECKMULTISIGVERIFY : 'OP_CHECKMULTISIGVERIFY', OP_NOP1 : 'OP_NOP1', - OP_NOP2 : 'OP_NOP2', + OP_CHECKLOCKTIMEVERIFY : 'OP_CHECKLOCKTIMEVERIFY', OP_NOP3 : 'OP_NOP3', OP_NOP4 : 'OP_NOP4', OP_NOP5 : 'OP_NOP5', @@ -591,7 +591,7 @@ def __new__(cls, n): 'OP_CHECKMULTISIG' : OP_CHECKMULTISIG, 'OP_CHECKMULTISIGVERIFY' : OP_CHECKMULTISIGVERIFY, 'OP_NOP1' : OP_NOP1, - 'OP_NOP2' : OP_NOP2, + 'OP_CHECKLOCKTIMEVERIFY' : OP_CHECKLOCKTIMEVERIFY, 'OP_NOP3' : OP_NOP3, 'OP_NOP4' : OP_NOP4, 'OP_NOP5' : OP_NOP5, diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py index ae2d91ab60b7c..584f318d0bbcd 100755 --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -120,7 +120,7 @@ def main(self): if self.options.coveragedir: enable_coverage(self.options.coveragedir) - os.environ['PATH'] = self.options.srcdir+":"+os.environ['PATH'] + os.environ['PATH'] = self.options.srcdir+":"+self.options.srcdir+"/qt:"+os.environ['PATH'] check_json_precision() diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py index b7e90a8a8bcdd..0388e08115cf0 100644 --- a/qa/rpc-tests/test_framework/util.py +++ b/qa/rpc-tests/test_framework/util.py @@ -1,4 +1,4 @@ -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # @@ -107,6 +107,7 @@ def initialize_datadir(dirname, n): f.write("rpcpassword=rt\n"); f.write("port="+str(p2p_port(n))+"\n"); f.write("rpcport="+str(rpc_port(n))+"\n"); + f.write("listenonion=0\n"); return datadir def initialize_chain(test_dir): @@ -130,7 +131,7 @@ def initialize_chain(test_dir): # Create cache directories, run bitcoinds: for i in range(4): datadir=initialize_datadir("cache", i) - args = [ os.getenv("BITCOIND", "bitcoind"), "-keypool=1", "-datadir="+datadir, "-discover=0" ] + args = [ os.getenv("BITCOIND", "bitcoind"), "-server", "-keypool=1", "-datadir="+datadir, "-discover=0" ] if i > 0: args.append("-connect=127.0.0.1:"+str(p2p_port(0))) bitcoind_processes[i] = subprocess.Popen(args) @@ -218,7 +219,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary= if binary is None: binary = os.getenv("BITCOIND", "bitcoind") # RPC tests still depend on free transactions - args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest", "-blockprioritysize=50000" ] + args = [ binary, "-datadir="+datadir, "-server", "-keypool=1", "-discover=0", "-rest", "-blockprioritysize=50000" ] if extra_args is not None: args.extend(extra_args) bitcoind_processes[i] = subprocess.Popen(args) devnull = open(os.devnull, "w") @@ -408,3 +409,67 @@ def assert_raises(exc, fun, *args, **kwds): def satoshi_round(amount): return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) + +def create_confirmed_utxos(fee, node, count): + node.generate(int(0.5*count)+101) + utxos = node.listunspent() + iterations = count - len(utxos) + addr1 = node.getnewaddress() + addr2 = node.getnewaddress() + if iterations <= 0: + return utxos + for i in xrange(iterations): + t = utxos.pop() + inputs = [] + inputs.append({ "txid" : t["txid"], "vout" : t["vout"]}) + outputs = {} + send_value = t['amount'] - fee + outputs[addr1] = satoshi_round(send_value/2) + outputs[addr2] = satoshi_round(send_value/2) + raw_tx = node.createrawtransaction(inputs, outputs) + signed_tx = node.signrawtransaction(raw_tx)["hex"] + txid = node.sendrawtransaction(signed_tx) + + while (node.getmempoolinfo()['size'] > 0): + node.generate(1) + + utxos = node.listunspent() + assert(len(utxos) >= count) + return utxos + +def gen_return_txouts(): + # Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create + # So we have big transactions (and therefore can't fit very many into each block) + # create one script_pubkey + script_pubkey = "6a4d0200" #OP_RETURN OP_PUSH2 512 bytes + for i in xrange (512): + script_pubkey = script_pubkey + "01" + # concatenate 128 txouts of above script_pubkey which we'll insert before the txout for change + txouts = "81" + for k in xrange(128): + # add txout value + txouts = txouts + "0000000000000000" + # add length of script_pubkey + txouts = txouts + "fd0402" + # add script_pubkey + txouts = txouts + script_pubkey + return txouts + +def create_lots_of_big_transactions(node, txouts, utxos, fee): + addr = node.getnewaddress() + txids = [] + for i in xrange(len(utxos)): + t = utxos.pop() + inputs = [] + inputs.append({ "txid" : t["txid"], "vout" : t["vout"]}) + outputs = {} + send_value = t['amount'] - fee + outputs[addr] = satoshi_round(send_value) + rawtx = node.createrawtransaction(inputs, outputs) + newtx = rawtx[0:92] + newtx = newtx + txouts + newtx = newtx + rawtx[94:] + signresult = node.signrawtransaction(newtx, None, None, "NONE") + txid = node.sendrawtransaction(signresult["hex"], True) + txids.append(txid) + return txids diff --git a/qa/rpc-tests/txn_clone.py b/qa/rpc-tests/txn_clone.py index b1f603a192445..bad090bcb45f0 100755 --- a/qa/rpc-tests/txn_clone.py +++ b/qa/rpc-tests/txn_clone.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/txn_doublespend.py b/qa/rpc-tests/txn_doublespend.py index d4665b3d4217c..05a3a347880ce 100755 --- a/qa/rpc-tests/txn_doublespend.py +++ b/qa/rpc-tests/txn_doublespend.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 6f6bc3189527e..6045b8268c481 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/walletbackup.py b/qa/rpc-tests/walletbackup.py index da100d7fc0d04..1221a09116791 100755 --- a/qa/rpc-tests/walletbackup.py +++ b/qa/rpc-tests/walletbackup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/qa/rpc-tests/zapwallettxes.py b/qa/rpc-tests/zapwallettxes.py index 0ec8ec53648c0..1ee0f79ac06ba 100755 --- a/qa/rpc-tests/zapwallettxes.py +++ b/qa/rpc-tests/zapwallettxes.py @@ -1,5 +1,5 @@ #!/usr/bin/env python2 -# Copyright (c) 2014 The Bitcoin Core developers +# Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/Makefile.am b/src/Makefile.am index bb627a544897c..5da1a873de5e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -117,7 +117,6 @@ BITCOIN_CORE_H = \ memusage.h \ merkleblock.h \ miner.h \ - mruset.h \ net.h \ netbase.h \ noui.h \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 4d0894b71199d..d89132f806607 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -59,7 +59,6 @@ BITCOIN_TESTS =\ test/mempool_tests.cpp \ test/merkle_tests.cpp \ test/miner_tests.cpp \ - test/mruset_tests.cpp \ test/multisig_tests.cpp \ test/netbase_tests.cpp \ test/pmt_tests.cpp \ diff --git a/src/alert.cpp b/src/alert.cpp index 91e54a9178e45..eb1cd5e7f6ebe 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -138,7 +138,7 @@ bool CAlert::RelayTo(CNode* pnode) const AppliesToMe() || GetAdjustedTime() < nRelayUntil) { - pnode->PushMessage("alert", *this); + pnode->PushMessage(NetMsgType::ALERT, *this); return true; } } diff --git a/src/alert.h b/src/alert.h index 4f9fff918165e..8cb86e338c5d2 100644 --- a/src/alert.h +++ b/src/alert.h @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/amount.cpp b/src/amount.cpp index b46918198448b..a3abd8cd835fb 100644 --- a/src/amount.cpp +++ b/src/amount.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/amount.h b/src/amount.h index a2e4a59d1f8fa..a48b17d514277 100644 --- a/src/amount.h +++ b/src/amount.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/arith_uint256.h b/src/arith_uint256.h index 103c78bb8e398..ba3d620158d47 100644 --- a/src/arith_uint256.h +++ b/src/arith_uint256.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin developers +// Copyright (c) 2009-2015 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/base58.cpp b/src/base58.cpp index c8091850560a7..5e26cf8d4738f 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/base58.h b/src/base58.h index 90014b9496a8f..a3980118aae34 100644 --- a/src/base58.h +++ b/src/base58.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 2fa91e4e77e5e..fb20521085583 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 9f8b2b98af490..026e87950f3d0 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -354,6 +354,18 @@ vector ParseHexUO(map& o, string strKey) return ParseHexUV(o[strKey], strKey); } +static CAmount AmountFromValue(const UniValue& value) +{ + if (!value.isNum() && !value.isStr()) + throw runtime_error("Amount is not a number or string"); + CAmount amount; + if (!ParseFixedPoint(value.getValStr(), 8, &amount)) + throw runtime_error("Invalid amount"); + if (!MoneyRange(amount)) + throw runtime_error("Amount out of range"); + return amount; +} + static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) { int nHashType = SIGHASH_ALL; @@ -425,7 +437,10 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) if ((unsigned int)nOut >= coins->vout.size()) coins->vout.resize(nOut+1); coins->vout[nOut].scriptPubKey = scriptPubKey; - coins->vout[nOut].nValue = 0; // we don't know the actual output value + coins->vout[nOut].nValue = 0; + if (prevOut.exists("amount")) { + coins->vout[nOut].nValue = AmountFromValue(prevOut["amount"]); + } } // if redeemScript given and private keys given, @@ -453,17 +468,19 @@ static void MutateTxSign(CMutableTransaction& tx, const string& flagStr) continue; } const CScript& prevPubKey = coins->vout[txin.prevout.n].scriptPubKey; + const CAmount& amount = coins->vout[txin.prevout.n].nValue; - txin.scriptSig.clear(); + SignatureData sigdata; // Only sign SIGHASH_SINGLE if there's a corresponding output: if (!fHashSingle || (i < mergedTx.vout.size())) - SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); + ProduceSignature(MutableTransactionSignatureCreator(&keystore, &mergedTx, i, amount, nHashType), prevPubKey, sigdata); // ... and merge in other signatures: - BOOST_FOREACH(const CTransaction& txv, txVariants) { - txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); - } - if (!VerifyScript(txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i))) + BOOST_FOREACH(const CTransaction& txv, txVariants) + sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i)); + UpdateTransaction(mergedTx, i, sigdata); + + if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx.wit.vtxinwit.size() > i ? &mergedTx.wit.vtxinwit[i].scriptWitness : NULL, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i, amount))) fComplete = false; } diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 4cee2d3cf0e6c..3b6608c95a2ad 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/bloom.cpp b/src/bloom.cpp index de87206592c35..4e6f0e5d2ddaa 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -216,30 +216,54 @@ void CBloomFilter::UpdateEmptyFull() isEmpty = empty; } -CRollingBloomFilter::CRollingBloomFilter(unsigned int nElements, double fpRate) : - b1(nElements * 2, fpRate, 0), b2(nElements * 2, fpRate, 0) +CRollingBloomFilter::CRollingBloomFilter(unsigned int nElements, double fpRate) { - // Implemented using two bloom filters of 2 * nElements each. - // We fill them up, and clear them, staggered, every nElements - // inserted, so at least one always contains the last nElements - // inserted. - nInsertions = 0; - nBloomSize = nElements * 2; - + double logFpRate = log(fpRate); + /* The optimal number of hash functions is log(fpRate) / log(0.5), but + * restrict it to the range 1-50. */ + nHashFuncs = std::max(1, std::min((int)round(logFpRate / log(0.5)), 50)); + /* In this rolling bloom filter, we'll store between 2 and 3 generations of nElements / 2 entries. */ + nEntriesPerGeneration = (nElements + 1) / 2; + uint32_t nMaxElements = nEntriesPerGeneration * 3; + /* The maximum fpRate = pow(1.0 - exp(-nHashFuncs * nMaxElements / nFilterBits), nHashFuncs) + * => pow(fpRate, 1.0 / nHashFuncs) = 1.0 - exp(-nHashFuncs * nMaxElements / nFilterBits) + * => 1.0 - pow(fpRate, 1.0 / nHashFuncs) = exp(-nHashFuncs * nMaxElements / nFilterBits) + * => log(1.0 - pow(fpRate, 1.0 / nHashFuncs)) = -nHashFuncs * nMaxElements / nFilterBits + * => nFilterBits = -nHashFuncs * nMaxElements / log(1.0 - pow(fpRate, 1.0 / nHashFuncs)) + * => nFilterBits = -nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs)) + */ + uint32_t nFilterBits = (uint32_t)ceil(-1.0 * nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs))); + data.clear(); + /* We store up to 16 'bits' per data element. */ + data.resize((nFilterBits + 15) / 16); reset(); } +/* Similar to CBloomFilter::Hash */ +inline unsigned int CRollingBloomFilter::Hash(unsigned int nHashNum, const std::vector& vDataToHash) const { + return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash) % (data.size() * 16); +} + void CRollingBloomFilter::insert(const std::vector& vKey) { - if (nInsertions == 0) { - b1.clear(); - } else if (nInsertions == nBloomSize / 2) { - b2.clear(); + if (nEntriesThisGeneration == nEntriesPerGeneration) { + nEntriesThisGeneration = 0; + nGeneration++; + if (nGeneration == 4) { + nGeneration = 1; + } + /* Wipe old entries that used this generation number. */ + for (uint32_t p = 0; p < data.size() * 16; p++) { + if (get(p) == nGeneration) { + put(p, 0); + } + } } - b1.insert(vKey); - b2.insert(vKey); - if (++nInsertions == nBloomSize) { - nInsertions = 0; + nEntriesThisGeneration++; + + for (int n = 0; n < nHashFuncs; n++) { + uint32_t h = Hash(n, vKey); + put(h, nGeneration); } } @@ -251,10 +275,13 @@ void CRollingBloomFilter::insert(const uint256& hash) bool CRollingBloomFilter::contains(const std::vector& vKey) const { - if (nInsertions < nBloomSize / 2) { - return b2.contains(vKey); + for (int n = 0; n < nHashFuncs; n++) { + uint32_t h = Hash(n, vKey); + if (get(h) == 0) { + return false; + } } - return b1.contains(vKey); + return true; } bool CRollingBloomFilter::contains(const uint256& hash) const @@ -265,8 +292,10 @@ bool CRollingBloomFilter::contains(const uint256& hash) const void CRollingBloomFilter::reset() { - unsigned int nNewTweak = GetRand(std::numeric_limits::max()); - b1.reset(nNewTweak); - b2.reset(nNewTweak); - nInsertions = 0; + nTweak = GetRand(std::numeric_limits::max()); + nEntriesThisGeneration = 0; + nGeneration = 1; + for (std::vector::iterator it = data.begin(); it != data.end(); it++) { + *it = 0; + } } diff --git a/src/bloom.h b/src/bloom.h index a4dba8cb4f718..b0ad8b875d04b 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -110,8 +110,11 @@ class CBloomFilter * reset() is provided, which also changes nTweak to decrease the impact of * false-positives. * - * contains(item) will always return true if item was one of the last N things + * contains(item) will always return true if item was one of the last N to 1.5*N * insert()'ed ... but may also return true for items that were not inserted. + * + * It needs around 1.8 bytes per element per factor 0.1 of false positive rate. + * (More accurately: 3/(log(256)*log(2)) * log(1/fpRate) * nElements bytes) */ class CRollingBloomFilter { @@ -129,10 +132,23 @@ class CRollingBloomFilter void reset(); private: - unsigned int nBloomSize; - unsigned int nInsertions; - CBloomFilter b1, b2; -}; + int nEntriesPerGeneration; + int nEntriesThisGeneration; + int nGeneration; + std::vector data; + unsigned int nTweak; + int nHashFuncs; + + unsigned int Hash(unsigned int nHashNum, const std::vector& vDataToHash) const; + inline int get(uint32_t position) const { + return (data[(position >> 4) % data.size()] >> (2 * (position & 0xF))) & 0x3; + } + + inline void put(uint32_t position, uint32_t val) { + uint32_t& cell = data[(position >> 4) % data.size()]; + cell = (cell & ~(((uint32_t)3) << (2 * (position & 0xF)))) | (val << (2 * (position & 0xF))); + } +}; #endif // BITCOIN_BLOOM_H diff --git a/src/chain.h b/src/chain.h index 01be2d6e5c940..b9b1b9306f26c 100644 --- a/src/chain.h +++ b/src/chain.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a46866a2be8fd..57c1a0e1b47e3 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -77,6 +77,7 @@ class CMainParams : public CChainParams { consensus.BIP34Height = 227931; consensus.BIP34Hash = uint256S("0x000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"); consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + consensus.SegWitHeight = 2000000000; consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 10 * 60; consensus.fPowAllowMinDifficultyBlocks = false; @@ -159,6 +160,7 @@ class CTestNetParams : public CChainParams { consensus.BIP34Height = 21111; consensus.BIP34Hash = uint256S("0x0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8"); consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + consensus.SegWitHeight = 2000000000; consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 10 * 60; consensus.fPowAllowMinDifficultyBlocks = true; @@ -179,7 +181,6 @@ class CTestNetParams : public CChainParams { vFixedSeeds.clear(); vSeeds.clear(); - vSeeds.push_back(CDNSSeedData("alexykot.me", "testnet-seed.alexykot.me")); vSeeds.push_back(CDNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org")); vSeeds.push_back(CDNSSeedData("bluematt.me", "testnet-seed.bluematt.me")); vSeeds.push_back(CDNSSeedData("bitcoin.schildbach.de", "testnet-seed.bitcoin.schildbach.de")); @@ -210,6 +211,59 @@ class CTestNetParams : public CChainParams { }; static CTestNetParams testNetParams; +/** + * Segnet + */ +class CSegNetParams : public CChainParams { +public: + CSegNetParams() { + strNetworkID = "segnet"; + consensus.nSubsidyHalvingInterval = 210000; + consensus.nMajorityEnforceBlockUpgrade = 7; + consensus.nMajorityRejectBlockOutdated = 9; + consensus.nMajorityWindow = 10; + consensus.BIP34Height = -1; + consensus.BIP34Hash = uint256(); + consensus.powLimit = uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + consensus.SegWitHeight = 0; + consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks + consensus.nPowTargetSpacing = 10 * 60; + consensus.fPowAllowMinDifficultyBlocks = true; + consensus.fPowNoRetargeting = false; + pchMessageStart[0] = 0x55; + pchMessageStart[1] = 0x61; + pchMessageStart[2] = 0xe4; + pchMessageStart[3] = 0x88; + vAlertPubKey = ParseHex("04302390343f91cc401d56d68b123028bf52e5fca1939df127f63c6467cdf9c8e2c14b61104cf817d0b780da337893ecc4aaff1309e536162dabbdb45200ca2b0a"); + nDefaultPort = 28333; + nMaxTipAge = 0x7fffffff; + nPruneAfterHeight = 1000; + + genesis = CreateGenesisBlock(1451529527, 414098458, 0x1d00ffff, 1, 50 * COIN); + consensus.hashGenesisBlock = genesis.GetHash(); + + vFixedSeeds.clear(); + vSeeds.clear(); + + base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,30); + base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,50); + base58Prefixes[SECRET_KEY] = std::vector(1,158); + base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x05)(0x35)(0x87)(0xCF).convert_to_container >(); + base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x05)(0x35)(0x83)(0x94).convert_to_container >(); + + vFixedSeeds.clear(); + + fMiningRequiresPeers = true; + fDefaultConsistencyChecks = false; + fRequireStandard = false; + fMineBlocksOnDemand = false; + fTestnetToBeDeprecatedFieldRPC = true; + + // checkpointData is empty + } +}; +static CSegNetParams segNetParams; + /** * Regression test */ @@ -224,6 +278,7 @@ class CRegTestParams : public CChainParams { consensus.BIP34Height = -1; // BIP34 has not necessarily activated on regtest consensus.BIP34Hash = uint256(); consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + consensus.SegWitHeight = 0; consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; // two weeks consensus.nPowTargetSpacing = 10 * 60; consensus.fPowAllowMinDifficultyBlocks = true; @@ -280,6 +335,8 @@ CChainParams& Params(const std::string& chain) return mainParams; else if (chain == CBaseChainParams::TESTNET) return testNetParams; + else if (chain == CBaseChainParams::SEGNET) + return segNetParams; else if (chain == CBaseChainParams::REGTEST) return regTestParams; else diff --git a/src/chainparams.h b/src/chainparams.h index 8aa0c71d610d8..fdf5c17a0ea2a 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index bc64cdc5d9b14..c63be2c96bc52 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -13,6 +13,7 @@ const std::string CBaseChainParams::MAIN = "main"; const std::string CBaseChainParams::TESTNET = "test"; const std::string CBaseChainParams::REGTEST = "regtest"; +const std::string CBaseChainParams::SEGNET = "segnet"; void AppendParamsHelpMessages(std::string& strUsage, bool debugHelp) { @@ -51,6 +52,20 @@ class CBaseTestNetParams : public CBaseChainParams }; static CBaseTestNetParams testNetParams; +/** + * Segnet + */ +class CBaseSegNetParams : public CBaseChainParams +{ +public: + CBaseSegNetParams() + { + nRPCPort = 28332; + strDataDir = "segnet"; + } +}; +static CBaseSegNetParams segNetParams; + /* * Regression test */ @@ -79,6 +94,8 @@ CBaseChainParams& BaseParams(const std::string& chain) return mainParams; else if (chain == CBaseChainParams::TESTNET) return testNetParams; + else if (chain == CBaseChainParams::SEGNET) + return segNetParams; else if (chain == CBaseChainParams::REGTEST) return regTestParams; else @@ -94,13 +111,16 @@ std::string ChainNameFromCommandLine() { bool fRegTest = GetBoolArg("-regtest", false); bool fTestNet = GetBoolArg("-testnet", false); + bool fSegNet = GetBoolArg("-segnet", false); - if (fTestNet && fRegTest) - throw std::runtime_error("Invalid combination of -regtest and -testnet."); + if ((int)fRegTest + (int)fTestNet + (int)fSegNet > 1) + throw std::runtime_error("Invalid combination of -regtest, -testnet, -segnet."); if (fRegTest) return CBaseChainParams::REGTEST; if (fTestNet) return CBaseChainParams::TESTNET; + if (fSegNet) + return CBaseChainParams::SEGNET; return CBaseChainParams::MAIN; } diff --git a/src/chainparamsbase.h b/src/chainparamsbase.h index 9c3e9a0ebf625..dea94820ae5b7 100644 --- a/src/chainparamsbase.h +++ b/src/chainparamsbase.h @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -19,6 +19,7 @@ class CBaseChainParams static const std::string MAIN; static const std::string TESTNET; static const std::string REGTEST; + static const std::string SEGNET; const std::string& DataDir() const { return strDataDir; } int RPCPort() const { return nRPCPort; } diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index a9822eed89b60..aefddce464152 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/checkpoints.h b/src/checkpoints.h index 5fce6fa81ef87..cd25ea5379dbd 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/checkqueue.h b/src/checkqueue.h index 20ba25bb419dd..32e25d5c8c6b7 100644 --- a/src/checkqueue.h +++ b/src/checkqueue.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/clientversion.h b/src/clientversion.h index 5a06b310a3b8a..c832663a767a3 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -15,7 +15,7 @@ //! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 0 -#define CLIENT_VERSION_MINOR 11 +#define CLIENT_VERSION_MINOR 12 #define CLIENT_VERSION_REVISION 99 #define CLIENT_VERSION_BUILD 0 diff --git a/src/coincontrol.h b/src/coincontrol.h index 3945644ce8d62..9626ad2c5b774 100644 --- a/src/coincontrol.h +++ b/src/coincontrol.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/coins.cpp b/src/coins.cpp index 122bf4e48d547..4d1dbdea4ed3c 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/coins.h b/src/coins.h index 60c1ba8a783e9..eab94ec1b4852 100644 --- a/src/coins.h +++ b/src/coins.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/compat.h b/src/compat.h index 20c2a25143bf9..1225ea18edb85 100644 --- a/src/compat.h +++ b/src/compat.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/compat/endian.h b/src/compat/endian.h index 9fec2a07faba5..6bfae42c7709f 100644 --- a/src/compat/endian.h +++ b/src/compat/endian.h @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin developers +// Copyright (c) 2014-2015 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h index 6d6ce7e0998e9..5a099cf53c57b 100644 --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/consensus/merkle.cpp b/src/consensus/merkle.cpp index 9a8afa8a33f3b..b10f1bae51adf 100644 --- a/src/consensus/merkle.cpp +++ b/src/consensus/merkle.cpp @@ -161,6 +161,17 @@ uint256 BlockMerkleRoot(const CBlock& block, bool* mutated) return ComputeMerkleRoot(leaves, mutated); } +uint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated) +{ + std::vector leaves; + leaves.resize(block.vtx.size()); + leaves[0].SetNull(); // The witness hash of the coinbase is 0. + for (size_t s = 1; s < block.vtx.size(); s++) { + leaves[s] = block.vtx[s].GetWitnessHash(); + } + return ComputeMerkleRoot(leaves, mutated); +} + std::vector BlockMerkleBranch(const CBlock& block, uint32_t position) { std::vector leaves; diff --git a/src/consensus/merkle.h b/src/consensus/merkle.h index 6ef59745ac653..194aea9b75dc3 100644 --- a/src/consensus/merkle.h +++ b/src/consensus/merkle.h @@ -22,6 +22,12 @@ uint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vector ParseHexUV(const UniValue& v, const std::strin // core_write.cpp extern std::string FormatScript(const CScript& script); -extern std::string EncodeHexTx(const CTransaction& tx); +extern std::string EncodeHexTx(const CTransaction& tx, bool fIncludeWitness = true); extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex); extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry); diff --git a/src/core_read.cpp b/src/core_read.cpp index 4be24f8e09725..85bd52b7f66ae 100644 --- a/src/core_read.cpp +++ b/src/core_read.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -96,7 +96,7 @@ bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx) return false; vector txData(ParseHex(strHexTx)); - CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); + CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); try { ssData >> tx; } @@ -113,7 +113,7 @@ bool DecodeHexBlk(CBlock& block, const std::string& strHexBlk) return false; std::vector blockData(ParseHex(strHexBlk)); - CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION); + CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); try { ssBlock >> block; } diff --git a/src/core_write.cpp b/src/core_write.cpp index 533fedfe7a686..e7982abf1f559 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -116,9 +116,9 @@ string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode) return str; } -string EncodeHexTx(const CTransaction& tx) +string EncodeHexTx(const CTransaction& tx, bool fIncludeWitness) { - CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); + CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | (fIncludeWitness ? SERIALIZE_TRANSACTION_WITNESS : 0)); ssTx << tx; return HexStr(ssTx.begin(), ssTx.end()); } diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index b6307cf0bf37a..1907e2fa78439 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/dbwrapper.h b/src/dbwrapper.h index 1d31ab8ae5c87..5e7313f7eb544 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/hash.cpp b/src/hash.cpp index 9711293e38695..7f3cf1a1faa74 100644 --- a/src/hash.cpp +++ b/src/hash.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2014 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/hash.h b/src/hash.h index daa92a0097000..97955c8d5ad6d 100644 --- a/src/hash.h +++ b/src/hash.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/init.cpp b/src/init.cpp index 645c8f94b13b8..c768ca75be769 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/init.h b/src/init.h index d4872e779480d..af1b94b72a520 100644 --- a/src/init.h +++ b/src/init.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/key.cpp b/src/key.cpp index a24fa8a4baa59..28ba5144e4314 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/key.h b/src/key.h index 021eac2a8dd77..6c820d49cd5fc 100644 --- a/src/key.h +++ b/src/key.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/keystore.cpp b/src/keystore.cpp index cf49ba83ade40..cc8a5733671da 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/keystore.h b/src/keystore.h index b917bf20b4c1d..d9290722e1b1a 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/limitedmap.h b/src/limitedmap.h index 5456dfc7c4aaf..4d9bb4fa21d5d 100644 --- a/src/limitedmap.h +++ b/src/limitedmap.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/main.cpp b/src/main.cpp index cb3f8f39f8ee5..44e2f84cd1cb9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -84,8 +84,8 @@ struct COrphanTx { CTransaction tx; NodeId fromPeer; }; -map mapOrphanTransactions GUARDED_BY(cs_main);; -map > mapOrphanTransactionsByPrev GUARDED_BY(cs_main);; +map mapOrphanTransactions GUARDED_BY(cs_main); +map > mapOrphanTransactionsByPrev GUARDED_BY(cs_main); void EraseOrphansFor(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main); /** @@ -181,7 +181,7 @@ namespace { * million to make it highly unlikely for users to have issues with this * filter. * - * Memory used: 1.7MB + * Memory used: 1.3 MB */ boost::scoped_ptr recentRejects; uint256 hashRecentRejectsChainTip; @@ -260,6 +260,8 @@ struct CNodeState { bool fPreferredDownload; //! Whether this peer wants invs or headers (when possible) for block announcements. bool fPreferHeaders; + //! Whether this peer can give us witnesses + bool fHaveWitness; CNodeState() { fCurrentlyConnected = false; @@ -275,6 +277,7 @@ struct CNodeState { nBlocksInFlightValidHeaders = 0; fPreferredDownload = false; fPreferHeaders = false; + fHaveWitness = false; } }; @@ -734,6 +737,20 @@ unsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& in return nSigOps; } +unsigned int GetWitnessSigOpCount(const CTransaction& tx, const CCoinsViewCache& inputs, int flags) +{ + if (tx.IsCoinBase()) + return 0; + + unsigned int nSigOps = 0; + for (unsigned int i = 0; i < tx.vin.size(); i++) + { + const CTxOut &prevout = inputs.GetOutputFor(tx.vin[i]); + nSigOps += CountWitnessSigOps(tx.vin[i].scriptSig, prevout.scriptPubKey, i < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[i].scriptWitness : NULL, flags); + } + return nSigOps; +} + @@ -749,7 +766,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state) if (tx.vout.empty()) return state.DoS(10, false, REJECT_INVALID, "bad-txns-vout-empty"); // Size limits - if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) + if (GetVirtualTransactionSize(tx) > MAX_BLOCK_SIZE) return state.DoS(100, false, REJECT_INVALID, "bad-txns-oversize"); // Check for negative or overflow output values @@ -800,32 +817,6 @@ void LimitMempoolSize(CTxMemPool& pool, size_t limit, unsigned long age) { pcoinsTip->Uncache(removed); } -CAmount GetMinRelayFee(const CTransaction& tx, const CTxMemPool& pool, unsigned int nBytes, bool fAllowFree) -{ - uint256 hash = tx.GetHash(); - double dPriorityDelta = 0; - CAmount nFeeDelta = 0; - pool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); - if (dPriorityDelta > 0 || nFeeDelta > 0) - return 0; - - CAmount nMinFee = ::minRelayTxFee.GetFee(nBytes); - - if (fAllowFree) - { - // There is a free transaction area in blocks created by most miners, - // * If we are relaying we allow transactions up to DEFAULT_BLOCK_PRIORITY_SIZE - 1000 - // to be considered to fall into this category. We don't want to encourage sending - // multiple transactions instead of one big transaction to avoid fees. - if (nBytes < (DEFAULT_BLOCK_PRIORITY_SIZE - 1000)) - nMinFee = 0; - } - - if (!MoneyRange(nMinFee)) - nMinFee = MAX_MONEY; - return nMinFee; -} - /** Convert CValidationState to a human-readable message for logging */ std::string FormatStateMessage(const CValidationState &state) { @@ -855,6 +846,11 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C if (fRequireStandard && !IsStandardTx(tx, reason)) return state.DoS(0, false, REJECT_NONSTANDARD, reason); + // Don't accept witness transactions before the final threshold passes + if (!GetBoolArg("-prematurewitness",false) && !tx.wit.IsNull() && !(chainActive.Tip()->nHeight + 1 >= Params().GetConsensus().SegWitHeight && IsSuperMajority(5, chainActive.Tip(), Params().GetConsensus().nMajorityRejectBlockOutdated, Params().GetConsensus()))) { + return state.DoS(0, false, REJECT_NONSTANDARD, "no-witness-yet"); + } + // Only accept nLockTime-using transactions that can be mined in the next // block; we don't want our mempool filled up with transactions that can't // be mined yet. @@ -962,12 +958,19 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C // merely non-standard transaction. unsigned int nSigOps = GetLegacySigOpCount(tx); nSigOps += GetP2SHSigOpCount(tx, view); + nSigOps += (GetWitnessSigOpCount(tx, view, STANDARD_SCRIPT_VERIFY_FLAGS) + 3) / 4; + if (nSigOps > MAX_STANDARD_TX_SIGOPS) return state.DoS(0, false, REJECT_NONSTANDARD, "bad-txns-too-many-sigops", false, strprintf("%d > %d", nSigOps, MAX_STANDARD_TX_SIGOPS)); CAmount nValueOut = tx.GetValueOut(); CAmount nFees = nValueIn-nValueOut; + // nModifiedFees includes any fee deltas from PrioritiseTransaction + CAmount nModifiedFees = nFees; + double nPriorityDummy = 0; + pool.ApplyDeltas(hash, nPriorityDummy, nModifiedFees); + CAmount inChainInputValue; double dPriority = view.GetPriority(tx, chainActive.Height(), inChainInputValue); @@ -985,16 +988,10 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C CTxMemPoolEntry entry(tx, nFees, GetTime(), dPriority, chainActive.Height(), pool.HasNoInputsOf(tx), inChainInputValue, fSpendsCoinbase, nSigOps); unsigned int nSize = entry.GetTxSize(); - // Don't accept it if it can't get into a block - CAmount txMinFee = GetMinRelayFee(tx, pool, nSize, true); - if (fLimitFree && nFees < txMinFee) - return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "insufficient fee", false, - strprintf("%d < %d", nFees, txMinFee)); - CAmount mempoolRejectFee = pool.GetMinFee(GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFee(nSize); - if (mempoolRejectFee > 0 && nFees < mempoolRejectFee) { + if (mempoolRejectFee > 0 && nModifiedFees < mempoolRejectFee) { return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "mempool min fee not met", false, strprintf("%d < %d", nFees, mempoolRejectFee)); - } else if (GetBoolArg("-relaypriority", DEFAULT_RELAYPRIORITY) && nFees < ::minRelayTxFee.GetFee(nSize) && !AllowFree(entry.GetPriority(chainActive.Height() + 1))) { + } else if (GetBoolArg("-relaypriority", DEFAULT_RELAYPRIORITY) && nModifiedFees < ::minRelayTxFee.GetFee(nSize) && !AllowFree(entry.GetPriority(chainActive.Height() + 1))) { // Require that free transactions have sufficient priority to be mined in the next block. return state.DoS(0, false, REJECT_INSUFFICIENTFEE, "insufficient priority"); } @@ -1002,7 +999,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C // Continuously rate-limit free (really, very-low-fee) transactions // This mitigates 'penny-flooding' -- sending thousands of free transactions just to // be annoying or make others' transactions take longer to confirm. - if (fLimitFree && nFees < ::minRelayTxFee.GetFee(nSize)) + if (fLimitFree && nModifiedFees < ::minRelayTxFee.GetFee(nSize)) { static CCriticalSection csFreeLimiter; static double dFreeCount; @@ -1067,7 +1064,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C LOCK(pool.cs); if (setConflicts.size()) { - CFeeRate newFeeRate(nFees, nSize); + CFeeRate newFeeRate(nModifiedFees, nSize); set setConflictsParents; const int maxDescendantsToVisit = 100; CTxMemPool::setEntries setIterConflicting; @@ -1110,7 +1107,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C // ignored when deciding whether or not to replace, we do // require the replacement to pay more overall fees too, // mitigating most cases. - CFeeRate oldFeeRate(mi->GetFee(), mi->GetTxSize()); + CFeeRate oldFeeRate(mi->GetModifiedFee(), mi->GetTxSize()); if (newFeeRate <= oldFeeRate) { return state.DoS(0, @@ -1138,7 +1135,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C pool.CalculateDescendants(it, allConflicting); } BOOST_FOREACH(CTxMemPool::txiter it, allConflicting) { - nConflictingFees += it->GetFee(); + nConflictingFees += it->GetModifiedFee(); nConflictingSize += it->GetTxSize(); } } else { @@ -1171,16 +1168,16 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C // The replacement must pay greater fees than the transactions it // replaces - if we did the bandwidth used by those conflicting // transactions would not be paid for. - if (nFees < nConflictingFees) + if (nModifiedFees < nConflictingFees) { return state.DoS(0, error("AcceptToMemoryPool: rejecting replacement %s, less fees than conflicting txs; %s < %s", - hash.ToString(), FormatMoney(nFees), FormatMoney(nConflictingFees)), + hash.ToString(), FormatMoney(nModifiedFees), FormatMoney(nConflictingFees)), REJECT_INSUFFICIENTFEE, "insufficient fee"); } // Finally in addition to paying more fees than the conflicts the // new transaction must pay for its own bandwidth. - CAmount nDeltaFees = nFees - nConflictingFees; + CAmount nDeltaFees = nModifiedFees - nConflictingFees; if (nDeltaFees < ::minRelayTxFee.GetFee(nSize)) { return state.DoS(0, @@ -1192,10 +1189,21 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C } } + unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS; + if (!Params().RequireStandard()) { + scriptVerifyFlags = GetArg("-promiscuousmempoolflags", scriptVerifyFlags); + } + // Check against previous transactions // This is done last to help prevent CPU exhaustion denial-of-service attacks. - if (!CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS, true)) + if (!CheckInputs(tx, state, view, true, scriptVerifyFlags, true)) { + if (CheckInputs(tx, state, view, true, scriptVerifyFlags & ~(SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_CLEANSTACK), true) && + !CheckInputs(tx, state, view, true, scriptVerifyFlags & ~SCRIPT_VERIFY_CLEANSTACK, true)) { + // Only the witness is wrong, so the transaction itself may be fine. + state.SetCorruptionPossible(); + } return false; + } // Check again against just the consensus-critical mandatory script // verification flags, in case of bugs in the standard flags that cause @@ -1218,7 +1226,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState &state, const C LogPrint("mempool", "replacing tx %s with %s for %s BTC additional fees, %d delta bytes\n", it->GetTx().GetHash().ToString(), hash.ToString(), - FormatMoney(nFees - nConflictingFees), + FormatMoney(nModifiedFees - nConflictingFees), (int)nSize - (int)nConflictingSize); } pool.RemoveStaged(allConflicting); @@ -1266,7 +1274,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, const Consensus::P if (fTxIndex) { CDiskTxPos postx; if (pblocktree->ReadTxIndex(hash, postx)) { - CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION); + CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); if (file.IsNull()) return error("%s: OpenBlockFile failed", __func__); CBlockHeader header; @@ -1325,7 +1333,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, const Consensus::P bool WriteBlockToDisk(const CBlock& block, CDiskBlockPos& pos, const CMessageHeader::MessageStartChars& messageStart) { // Open history file to append - CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION); + CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); if (fileout.IsNull()) return error("WriteBlockToDisk: OpenBlockFile failed"); @@ -1348,7 +1356,7 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus: block.SetNull(); // Open history file to read - CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); + CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); if (filein.IsNull()) return error("ReadBlockFromDisk: OpenBlockFile failed for %s", pos.ToString()); @@ -1585,7 +1593,8 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool CScriptCheck::operator()() { const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; - if (!VerifyScript(scriptSig, scriptPubKey, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, cacheStore), &error)) { + const CScriptWitness *witness = (nIn < ptxTo->wit.vtxinwit.size()) ? &ptxTo->wit.vtxinwit[nIn].scriptWitness : NULL; + if (!VerifyScript(scriptSig, scriptPubKey, witness, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, amount, cacheStore), &error)) { return false; } return true; @@ -1680,9 +1689,9 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi // arguments; if so, don't trigger DoS protection to // avoid splitting the network between upgraded and // non-upgraded nodes. - CScriptCheck check(*coins, tx, i, + CScriptCheck check2(*coins, tx, i, flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, cacheStore); - if (check()) + if (check2()) return state.Invalid(false, REJECT_NONSTANDARD, strprintf("non-mandatory-script-verify-flag (%s)", ScriptErrorString(check.GetScriptError()))); } // Failures of other flags indicate a transaction that is @@ -1722,7 +1731,7 @@ bool UndoWriteToDisk(const CBlockUndo& blockundo, CDiskBlockPos& pos, const uint fileout << blockundo; // calculate & write checksum - CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION); + CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); hasher << hashBlock; hasher << blockundo; fileout << hasher.GetHash(); @@ -1748,7 +1757,7 @@ bool UndoReadFromDisk(CBlockUndo& blockundo, const CDiskBlockPos& pos, const uin } // Verify checksum - CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION); + CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); hasher << hashBlock; hasher << blockundo; if (hashChecksum != hasher.GetHash()) @@ -1987,10 +1996,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin int64_t nTimeStart = GetTimeMicros(); - // Check it again in case a previous version let a bad block in - if (!CheckBlock(block, state, !fJustCheck, !fJustCheck)) - return false; - // verify that the view's current state corresponds to the previous block uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash(); assert(hashPrevBlock == view.GetBestBlock()); @@ -2003,6 +2008,10 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return true; } + // Check it again in case a previous version let a bad block in + if (!CheckBlock(block, state, !fJustCheck, !fJustCheck)) + return false; + bool fScriptChecks = true; if (fCheckpointsEnabled) { CBlockIndex *pindexLastCheckpoint = Checkpoints::GetLastCheckpoint(chainparams.Checkpoints()); @@ -2068,6 +2077,12 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY; } + // Start enforcing WITNESS rules, for block.nVersion=5 + // blocks, when 75% of the network has upgraded: + if (block.nVersion >= 5 && pindex->nHeight >= chainparams.GetConsensus().SegWitHeight && IsSuperMajority(5, pindex->pprev, chainparams.GetConsensus().nMajorityEnforceBlockUpgrade, chainparams.GetConsensus())) { + flags |= SCRIPT_VERIFY_WITNESS; + } + int64_t nTime2 = GetTimeMicros(); nTimeForks += nTime2 - nTime1; LogPrint("bench", " - Fork checks: %.2fms [%.2fs]\n", 0.001 * (nTime2 - nTime1), nTimeForks * 0.000001); @@ -2078,6 +2093,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin CAmount nFees = 0; int nInputs = 0; unsigned int nSigOps = 0; + unsigned int nWitSigOps = 0; CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); std::vector > vPos; vPos.reserve(block.vtx.size()); @@ -2098,13 +2114,15 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin return state.DoS(100, error("ConnectBlock(): inputs missing/spent"), REJECT_INVALID, "bad-txns-inputs-missingorspent"); + nWitSigOps += GetWitnessSigOpCount(tx, view, flags); + if (fStrictPayToScriptHash) { // Add in sigops done by pay-to-script-hash inputs; // this is to prevent a "rogue miner" from creating // an incredibly-expensive-to-validate block. nSigOps += GetP2SHSigOpCount(tx, view); - if (nSigOps > MAX_BLOCK_SIGOPS) + if (nSigOps + (nWitSigOps + 3) / 4 > MAX_BLOCK_SIGOPS) return state.DoS(100, error("ConnectBlock(): too many sigops"), REJECT_INVALID, "bad-blk-sigops"); } @@ -2126,7 +2144,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin UpdateCoins(tx, state, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight); vPos.push_back(std::make_pair(tx.GetHash(), pos)); - pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); + pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); } int64_t nTime3 = GetTimeMicros(); nTimeConnect += nTime3 - nTime2; LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime3 - nTime2), 0.001 * (nTime3 - nTime2) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime3 - nTime2) / (nInputs-1), nTimeConnect * 0.000001); @@ -2932,6 +2950,9 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW) { + if (block.GetHash() == Params().GetConsensus().hashGenesisBlock) + return true; + // Check proof of work matches claimed amount if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus())) return state.DoS(50, error("CheckBlockHeader(): proof of work failed"), @@ -2978,7 +2999,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo // because we receive the wrong transactions for it. // Size limits - if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE) + if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE || GetVirtualBlockSize(block) > MAX_BLOCK_SIZE) return state.DoS(100, error("CheckBlock(): size limits failed"), REJECT_INVALID, "bad-blk-length"); @@ -3005,7 +3026,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo } if (nSigOps > MAX_BLOCK_SIGOPS) return state.DoS(100, error("CheckBlock(): out-of-bounds SigOpCount"), - REJECT_INVALID, "bad-blk-sigops", true); + REJECT_INVALID, "bad-blk-sigops"); if (fCheckPOW && fCheckMerkleRoot) block.fChecked = true; @@ -3027,6 +3048,74 @@ static bool CheckIndexAgainstCheckpoint(const CBlockIndex* pindexPrev, CValidati return true; } +std::vector GenerateCoinbaseCommitment(const CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) +{ + std::vector ret; + if (block.nVersion >= 5 && pindexPrev->nHeight + 1 >= consensusParams.SegWitHeight && IsSuperMajority(5, pindexPrev, consensusParams.nMajorityEnforceBlockUpgrade, consensusParams)) { + ret.push_back(0xaa); + ret.push_back(0x21); + ret.push_back(0xa9); + ret.push_back(0xed); + ret.push_back(0x00); + ret.push_back(0x00); + ret.push_back(0x00); + ret.push_back(0x00); + ret.push_back(0x00); + uint256 witnessroot = BlockWitnessMerkleRoot(block, NULL); + ret.insert(ret.end(), witnessroot.begin(), witnessroot.end()); + } + return ret; +} + +CTxWitness GenerateCoinbaseWitness(const CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams) +{ + CTxWitness ret; + if (block.nVersion >= 5 && pindexPrev->nHeight + 1 >= consensusParams.SegWitHeight && IsSuperMajority(5, pindexPrev, consensusParams.nMajorityEnforceBlockUpgrade, consensusParams)) { + ret.vtxinwit.resize(1); + ret.vtxinwit[0].scriptWitness.stack.resize(1); + } + return ret; +} + +static bool CheckCoinbaseCommitment(const CScript& script, const uint256& leaf, const std::vector pathdata, const unsigned char typ[16]) +{ + CScript::const_iterator it = script.begin(); + std::vector data; + while (it != script.end()) { + opcodetype op; + if (!script.GetOp(it, op, data) || op != 41 || data.size() != 41) { + continue; + } + if (data[0] != 0xaa || data[1] != 0x21 || data[2] != 0xa9 || data[3] != 0xed) { + continue; + } + uint256 result; + CSHA256().Write(typ, 16).Write(&data[4], 4).Finalize(result.begin()); + uint32_t result32 = ReadLE32(result.begin()); + // TODO: remove countbits from coinbase scriptSig + int countbits = pathdata.size() >> 5; + if (pathdata.size() & 0x1F) { + return false; + } + if (countbits > 32) { + return false; + } + if (countbits < 32) { + result32 >>= (32 - countbits); + } + std::vector path; + path.resize(countbits); + for (unsigned int i = 0; i < countbits; i++) { + memcpy(path[i].begin(), &pathdata[32 * i], 32); + } + uint256 root1 = ComputeMerkleRootFromBranch(leaf, path, result32); + uint256 root2; + memcpy(root2.begin(), &data[9], 32); + return root1 == root2; + } + return false; +} + bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex * const pindexPrev) { const Consensus::Params& consensusParams = Params().GetConsensus(); @@ -3055,9 +3144,17 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta return state.Invalid(error("%s : rejected nVersion=3 block", __func__), REJECT_OBSOLETE, "bad-version"); + // Reject block.nVersion=4 blocks when 95% (75% on testnet) of the network has upgraded: + if (block.nVersion < 5 && pindexPrev->nHeight + 1 >= consensusParams.SegWitHeight && IsSuperMajority(5, pindexPrev, consensusParams.nMajorityRejectBlockOutdated, consensusParams)) + return state.Invalid(error("%s : rejected nVersion=4 block", __func__), + REJECT_OBSOLETE, "bad-version"); + + return true; } +static const unsigned char vTypeWitnessCommitment[16] = {'W', 'i', 't', 'n', 'e', 's', 's', 'V', '1'}; + bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIndex * const pindexPrev) { const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1; @@ -3085,6 +3182,43 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn } } + // Validation for witness commitments. + // * We compute the witness hash (which is the hash including witnesses) of all the block's transactions, except the + // coinbase (where 0x0000....0000 is used instead). + // * We build a merkle tree with all those witness hashes as leaves (similar to the hashMerkleRoot in the block header). + // * The first coinbase scriptSig minimal push of 41 bytes for which the first 4 bytes are {0xaa, 0x21, 0xa9, 0xed} is + // treated as a commitment header. If no such push is present, the block is invalid. If multiple are present, the first + // is used. + // * The first 4 bytes of the commitment header are just magic identifier bytes, and have no further meaning. + // * The next 4 bytes describe a nonce. + // * The next 1 byte is ignored. + // * The last 32 bytes of the commitment header are its root hash. + // * The coinbase's input's witness must consist of a single byte array of 32 * levels bytes, and are assumed to be + // the Merkle path to connect the witness root hash to the commitment root hash. + // * locator = SHA256('WitnessV1\x00\x00\x00\x00\x00\x00\x00' || nonce). The first levels bits of locator, interpreted + // in little endian, are assumed to be the position in the leaves of this Merkle tree where the witness commitment + // goes. + if (block.nVersion >= 5 && pindexPrev->nHeight + 1 >= consensusParams.SegWitHeight && IsSuperMajority(5, pindexPrev, consensusParams.nMajorityEnforceBlockUpgrade, consensusParams)) { + bool malleated = false; + uint256 hashWitness = BlockWitnessMerkleRoot(block, &malleated); + if (malleated) { + return state.DoS(100, error("%s : witness merkle root duplication", __func__), REJECT_INVALID, "bad-witness-duplicate", true); + } + if (block.vtx[0].wit.vtxinwit.size() == 0 || block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.size() != 1) { + return state.DoS(100, error("%s : invalid witness merkle path length", __func__), REJECT_INVALID, "bad-witness-merkle-len", true); + } + if (!CheckCoinbaseCommitment(block.vtx[0].vin[0].scriptSig, hashWitness, block.vtx[0].wit.vtxinwit[0].scriptWitness.stack[0], vTypeWitnessCommitment)) { + return state.DoS(100, error("%s : witness merkle commitment mismatch", __func__), REJECT_INVALID, "bad-witness-merkle-match", true); + } + } else { + // No witness data is allowed in blocks that don't commit to witness data, as this would otherwise leave room from spam. + for (size_t i = 0; i < block.vtx.size(); i++) { + if (!block.vtx[i].wit.IsNull()) { + return state.DoS(100, error("%s : unexpected witness data found", __func__), REJECT_INVALID, "unexpected-witness", true); + } + } + } + return true; } @@ -3178,7 +3312,7 @@ static bool AcceptBlock(const CBlock& block, CValidationState& state, const CCha // Write block to history file try { - unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION); + unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); CDiskBlockPos blockPos; if (dbp != NULL) blockPos = *dbp; @@ -3443,7 +3577,7 @@ CBlockIndex * InsertBlockIndex(uint256 hash) bool static LoadBlockIndexDB() { const CChainParams& chainparams = Params(); - if (!pblocktree->LoadBlockIndexGuts()) + if (!pblocktree->LoadBlockIndexGuts(chainparams.GetConsensus())) return false; boost::this_thread::interruption_point(); @@ -3698,7 +3832,7 @@ bool InitBlockIndex(const CChainParams& chainparams) try { CBlock &block = const_cast(chainparams.GenesisBlock()); // Start new block file - unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION); + unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); CDiskBlockPos blockPos; CValidationState state; if (!FindBlockPos(state, blockPos, nBlockSize+8, 0, block.GetBlockTime())) @@ -3729,7 +3863,7 @@ bool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskB int nLoaded = 0; try { // This takes over fileIn and calls fclose() on it in the CBufferedFile destructor - CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION); + CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SIZE, MAX_BLOCK_SIZE+8, SER_DISK, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS); uint64_t nRewind = blkdat.GetPos(); while (!blkdat.eof()) { boost::this_thread::interruption_point(); @@ -4085,9 +4219,11 @@ std::string GetWarnings(const std::string& strFor) bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main) { - switch (inv.type) + uint32_t msgType = inv.type & MSG_TYPE_MASK; + switch (msgType) { case MSG_TX: + case MSG_WITNESS_TX: { assert(recentRejects); if (chainActive.Tip()->GetBlockHash() != hashRecentRejectsChainTip) @@ -4106,6 +4242,7 @@ bool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main) pcoinsTip->HaveCoins(inv.hash); } case MSG_BLOCK: + case MSG_WITNESS_BLOCK: return mapBlockIndex.count(inv.hash); } // Don't know what it is, just say we already got one @@ -4130,7 +4267,10 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam boost::this_thread::interruption_point(); it++; - if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK) + uint32_t msgType = inv.type & MSG_TYPE_MASK; + bool fSendWitness = inv.type & MSG_WITNESS_FLAG; + + if (msgType == MSG_BLOCK || msgType == MSG_FILTERED_BLOCK || msgType == MSG_WITNESS_BLOCK) { bool send = false; BlockMap::iterator mi = mapBlockIndex.find(inv.hash); @@ -4154,7 +4294,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam // disconnect node in case we have reached the outbound limit for serving historical blocks // never disconnect whitelisted nodes static const int nOneWeek = 7 * 24 * 60 * 60; // assume > 1 week = historical - if (send && CNode::OutboundTargetReached(true) && ( ((pindexBestHeader != NULL) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > nOneWeek)) || inv.type == MSG_FILTERED_BLOCK) && !pfrom->fWhitelisted) + if (send && CNode::OutboundTargetReached(true) && ( ((pindexBestHeader != NULL) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > nOneWeek)) || msgType == MSG_FILTERED_BLOCK) && !pfrom->fWhitelisted) { LogPrint("net", "historical block serving limit reached, disconnect peer=%d\n", pfrom->GetId()); @@ -4170,15 +4310,17 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam CBlock block; if (!ReadBlockFromDisk(block, (*mi).second, consensusParams)) assert(!"cannot load block from disk"); - if (inv.type == MSG_BLOCK) - pfrom->PushMessage("block", block); + if (msgType == MSG_BLOCK) + pfrom->PushMessageWithFlag(fSendWitness ? SERIALIZE_TRANSACTION_WITNESS : 0, NetMsgType::BLOCK, block); + if (msgType == MSG_WITNESS_BLOCK) + pfrom->PushMessageWithFlag(SERIALIZE_TRANSACTION_WITNESS, NetMsgType::BLOCK, block); else // MSG_FILTERED_BLOCK) { LOCK(pfrom->cs_filter); if (pfrom->pfilter) { CMerkleBlock merkleBlock(block, *pfrom->pfilter); - pfrom->PushMessage("merkleblock", merkleBlock); + pfrom->PushMessageWithFlag(fSendWitness ? SERIALIZE_TRANSACTION_WITNESS : 0, NetMsgType::MERKLEBLOCK, merkleBlock); // CMerkleBlock just contains hashes, so also push any transactions in the block the client did not see // This avoids hurting performance by pointlessly requiring a round-trip // Note that there is currently no way for a node to request any single transactions we didn't send here - @@ -4187,8 +4329,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam // however we MUST always provide at least what the remote peer needs typedef std::pair PairType; BOOST_FOREACH(PairType& pair, merkleBlock.vMatchedTxn) - if (!pfrom->setInventoryKnown.count(CInv(MSG_TX, pair.second))) - pfrom->PushMessage("tx", block.vtx[pair.first]); + pfrom->PushMessageWithFlag(fSendWitness ? SERIALIZE_TRANSACTION_WITNESS : 0, NetMsgType::TX, block.vtx[pair.first]); } // else // no response @@ -4202,30 +4343,27 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam // wait for other stuff first. vector vInv; vInv.push_back(CInv(MSG_BLOCK, chainActive.Tip()->GetBlockHash())); - pfrom->PushMessage("inv", vInv); + pfrom->PushMessage(NetMsgType::INV, vInv); pfrom->hashContinue.SetNull(); } } } - else if (inv.IsKnownType()) + else if (msgType == MSG_TX || msgType == MSG_WITNESS_TX) { // Send stream from relay memory bool pushed = false; { - LOCK(cs_mapRelay); - map::iterator mi = mapRelay.find(inv); - if (mi != mapRelay.end()) { - pfrom->PushMessage(inv.GetCommand(), (*mi).second); + LOCK(cs_mapRelayTx); + map::iterator mi = mapRelayTx.find(inv.hash); + if (mi != mapRelayTx.end()) { + pfrom->PushMessageWithFlag((fSendWitness || msgType == MSG_WITNESS_TX) ? SERIALIZE_TRANSACTION_WITNESS : 0, NetMsgType::TX, (*mi).second); pushed = true; } } - if (!pushed && inv.type == MSG_TX) { + if (!pushed && (msgType == MSG_TX || msgType == MSG_WITNESS_TX)) { CTransaction tx; if (mempool.lookup(inv.hash, tx)) { - CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); - ss.reserve(1000); - ss << tx; - pfrom->PushMessage("tx", ss); + pfrom->PushMessageWithFlag((fSendWitness || msgType == MSG_WITNESS_TX) ? SERIALIZE_TRANSACTION_WITNESS : 0, NetMsgType::TX, tx); pushed = true; } } @@ -4237,7 +4375,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam // Track requests for our stuff. GetMainSignals().Inventory(inv.hash); - if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK) + if (msgType == MSG_BLOCK || msgType == MSG_FILTERED_BLOCK || msgType == MSG_WITNESS_BLOCK) break; } } @@ -4252,10 +4390,15 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam // do that because they want to know about (and store and rebroadcast and // risk analyze) the dependencies of transactions relevant to them, without // having to download the entire memory pool. - pfrom->PushMessage("notfound", vNotFound); + pfrom->PushMessage(NetMsgType::NOTFOUND, vNotFound); } } +bool static RequireWitness(CBlockIndex* pindex, const Consensus::Params& consensusParams) +{ + return (pindex->nVersion >= 5 && pindex->nHeight >= consensusParams.SegWitHeight && IsSuperMajority(5, pindex->pprev, consensusParams.nMajorityEnforceBlockUpgrade, consensusParams)); +} + bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int64_t nTimeReceived) { const CChainParams& chainparams = Params(); @@ -4269,9 +4412,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (!(nLocalServices & NODE_BLOOM) && - (strCommand == "filterload" || - strCommand == "filteradd" || - strCommand == "filterclear")) + (strCommand == NetMsgType::FILTERLOAD || + strCommand == NetMsgType::FILTERADD || + strCommand == NetMsgType::FILTERCLEAR)) { if (pfrom->nVersion >= NO_BLOOM_VERSION) { Misbehaving(pfrom->GetId(), 100); @@ -4283,12 +4426,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - if (strCommand == "version") + if (strCommand == NetMsgType::VERSION) { // Each connection can only send one version message if (pfrom->nVersion != 0) { - pfrom->PushMessage("reject", strCommand, REJECT_DUPLICATE, string("Duplicate version message")); + pfrom->PushMessage(NetMsgType::REJECT, strCommand, REJECT_DUPLICATE, string("Duplicate version message")); Misbehaving(pfrom->GetId(), 1); return false; } @@ -4302,7 +4445,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, { // disconnect from peers older than this proto version LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion); - pfrom->PushMessage("reject", strCommand, REJECT_OBSOLETE, + pfrom->PushMessage(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE, strprintf("Version must be %d or greater", MIN_PEER_PROTO_VERSION)); pfrom->fDisconnect = true; return false; @@ -4347,7 +4490,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, UpdatePreferredDownload(pfrom, State(pfrom->GetId())); // Change version - pfrom->PushMessage("verack"); + pfrom->PushMessage(NetMsgType::VERACK); pfrom->ssSend.SetVersion(min(pfrom->nVersion, PROTOCOL_VERSION)); if (!pfrom->fInbound) @@ -4370,7 +4513,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Get recent addresses if (pfrom->fOneShot || pfrom->nVersion >= CADDR_TIME_VERSION || addrman.size() < 1000) { - pfrom->PushMessage("getaddr"); + pfrom->PushMessage(NetMsgType::GETADDR); pfrom->fGetAddr = true; } addrman.Good(pfrom->addr); @@ -4414,7 +4557,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "verack") + else if (strCommand == NetMsgType::VERACK) { pfrom->SetRecvVersion(min(pfrom->nVersion, PROTOCOL_VERSION)); @@ -4429,12 +4572,16 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // We send this to non-NODE NETWORK peers as well, because even // non-NODE NETWORK peers can announce blocks (such as pruning // nodes) - pfrom->PushMessage("sendheaders"); + pfrom->PushMessage(NetMsgType::SENDHEADERS); + } + + if (pfrom->nVersion >= WITNESS_VERSION) { + pfrom->PushMessage(NetMsgType::HAVEWITNESS); } } - else if (strCommand == "addr") + else if (strCommand == NetMsgType::ADDR) { vector vAddr; vRecv >> vAddr; @@ -4500,14 +4647,21 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->fDisconnect = true; } - else if (strCommand == "sendheaders") + else if (strCommand == NetMsgType::SENDHEADERS) { LOCK(cs_main); State(pfrom->GetId())->fPreferHeaders = true; } - else if (strCommand == "inv") + else if (strCommand == NetMsgType::HAVEWITNESS) + { + LOCK(cs_main); + State(pfrom->GetId())->fHaveWitness = true; + } + + + else if (strCommand == NetMsgType::INV) { vector vInv; vRecv >> vInv; @@ -4529,7 +4683,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) { - const CInv &inv = vInv[nInv]; + CInv &inv = vInv[nInv]; boost::this_thread::interruption_point(); pfrom->AddInventoryKnown(inv); @@ -4537,6 +4691,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, bool fAlreadyHave = AlreadyHave(inv); LogPrint("net", "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom->id); + if (inv.type == MSG_TX && State(pfrom->GetId())->fHaveWitness) { + inv.type = MSG_WITNESS_TX; + } + if (inv.type == MSG_BLOCK) { UpdateBlockAvailability(pfrom->GetId(), inv.hash); if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(inv.hash)) { @@ -4548,10 +4706,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // time the block arrives, the header chain leading up to it is already validated. Not // doing this will result in the received block being rejected as an orphan in case it is // not a direct successor. - pfrom->PushMessage("getheaders", chainActive.GetLocator(pindexBestHeader), inv.hash); + pfrom->PushMessage(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexBestHeader), inv.hash); CNodeState *nodestate = State(pfrom->GetId()); if (CanDirectFetch(chainparams.GetConsensus()) && - nodestate->nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) { + nodestate->nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER && + (!RequireWitness(chainActive.Tip(), chainparams.GetConsensus()) || State(pfrom->GetId())->fHaveWitness)) { + if (State(pfrom->GetId())->fHaveWitness) { + inv.type = MSG_WITNESS_BLOCK; + } vToFetch.push_back(inv); // Mark block as in flight already, even though the actual "getdata" message only goes out // later (within the same cs_main lock, though). @@ -4578,11 +4740,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } if (!vToFetch.empty()) - pfrom->PushMessage("getdata", vToFetch); + pfrom->PushMessage(NetMsgType::GETDATA, vToFetch); } - else if (strCommand == "getdata") + else if (strCommand == NetMsgType::GETDATA) { vector vInv; vRecv >> vInv; @@ -4603,7 +4765,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "getblocks") + else if (strCommand == NetMsgType::GETBLOCKS) { CBlockLocator locator; uint256 hashStop; @@ -4647,7 +4809,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "getheaders") + else if (strCommand == NetMsgType::GETHEADERS) { CBlockLocator locator; uint256 hashStop; @@ -4692,11 +4854,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // headers message). In both cases it's safe to update // pindexBestHeaderSent to be our tip. nodestate->pindexBestHeaderSent = pindex ? pindex : chainActive.Tip(); - pfrom->PushMessage("headers", vHeaders); + pfrom->PushMessage(NetMsgType::HEADERS, vHeaders); } - else if (strCommand == "tx") + else if (strCommand == NetMsgType::TX) { // Stop processing the transaction early if // We are in blocks only mode and peer is either not whitelisted or whitelistalwaysrelay is off @@ -4709,7 +4871,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, vector vWorkQueue; vector vEraseQueue; CTransaction tx; - vRecv >> tx; + WithOrVersion(&vRecv, SERIALIZE_TRANSACTION_WITNESS) >> tx; CInv inv(MSG_TX, tx.GetHash()); pfrom->AddInventoryKnown(inv); @@ -4797,8 +4959,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, if (nEvicted > 0) LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted); } else { - assert(recentRejects); - recentRejects->insert(tx.GetHash()); + if (!state.CorruptionPossible()) { + assert(recentRejects); + recentRejects->insert(tx.GetHash()); + } if (pfrom->fWhitelisted && GetBoolArg("-whitelistalwaysrelay", DEFAULT_WHITELISTALWAYSRELAY)) { // Always relay transactions received from whitelisted peers, even @@ -4825,16 +4989,19 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pfrom->id, FormatStateMessage(state)); if (state.GetRejectCode() < REJECT_INTERNAL) // Never send AcceptToMemoryPool's internal codes over P2P - pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), + pfrom->PushMessage(NetMsgType::REJECT, strCommand, (unsigned char)state.GetRejectCode(), state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash); - if (nDoS > 0) + if (nDoS > 0 && (!state.CorruptionPossible() || State(pfrom->id)->fHaveWitness)) { + // When a non-witness-supporting peer gives us a transaction that would + // be accepted if witness validation was off, we can't blame them for it. Misbehaving(pfrom->GetId(), nDoS); + } } FlushStateToDisk(state, FLUSH_STATE_PERIODIC); } - else if (strCommand == "headers" && !fImporting && !fReindex) // Ignore headers received while importing + else if (strCommand == NetMsgType::HEADERS && !fImporting && !fReindex) // Ignore headers received while importing { std::vector headers; @@ -4882,7 +5049,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue // from there instead. LogPrint("net", "more getheaders (%d) to end to peer=%d (startheight:%d)\n", pindexLast->nHeight, pfrom->id, pfrom->nStartingHeight); - pfrom->PushMessage("getheaders", chainActive.GetLocator(pindexLast), uint256()); + pfrom->PushMessage(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexLast), uint256()); } bool fCanDirectFetch = CanDirectFetch(chainparams.GetConsensus()); @@ -4895,7 +5062,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Calculate all the blocks we'd need to switch to pindexLast, up to a limit. while (pindexWalk && !chainActive.Contains(pindexWalk) && vToFetch.size() <= MAX_BLOCKS_IN_TRANSIT_PER_PEER) { if (!(pindexWalk->nStatus & BLOCK_HAVE_DATA) && - !mapBlocksInFlight.count(pindexWalk->GetBlockHash())) { + !mapBlocksInFlight.count(pindexWalk->GetBlockHash()) && + (!RequireWitness(chainActive.Tip(), chainparams.GetConsensus()) || State(pfrom->GetId())->fHaveWitness)) { // We don't have this block, and it's not yet in flight. vToFetch.push_back(pindexWalk); } @@ -4917,7 +5085,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // Can't download any more from this peer break; } - vGetData.push_back(CInv(MSG_BLOCK, pindex->GetBlockHash())); + vGetData.push_back(CInv(State(pfrom->GetId())->fHaveWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK, pindex->GetBlockHash())); MarkBlockAsInFlight(pfrom->GetId(), pindex->GetBlockHash(), chainparams.GetConsensus(), pindex); LogPrint("net", "Requesting block %s from peer=%d\n", pindex->GetBlockHash().ToString(), pfrom->id); @@ -4927,7 +5095,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, pindexLast->GetBlockHash().ToString(), pindexLast->nHeight); } if (vGetData.size() > 0) { - pfrom->PushMessage("getdata", vGetData); + pfrom->PushMessage(NetMsgType::GETDATA, vGetData); } } } @@ -4935,10 +5103,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, CheckBlockIndex(chainparams.GetConsensus()); } - else if (strCommand == "block" && !fImporting && !fReindex) // Ignore blocks received while importing + else if (strCommand == NetMsgType::BLOCK && !fImporting && !fReindex) // Ignore blocks received while importing { CBlock block; - vRecv >> block; + WithOrVersion(&vRecv, SERIALIZE_TRANSACTION_WITNESS) >> block; CInv inv(MSG_BLOCK, block.GetHash()); LogPrint("net", "received block %s peer=%d\n", inv.hash.ToString(), pfrom->id); @@ -4955,7 +5123,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int nDoS; if (state.IsInvalid(nDoS)) { assert (state.GetRejectCode() < REJECT_INTERNAL); // Blocks are never rejected with internal reject codes - pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), + pfrom->PushMessage(NetMsgType::REJECT, strCommand, (unsigned char)state.GetRejectCode(), state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash); if (nDoS > 0) { LOCK(cs_main); @@ -4971,7 +5139,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // to users' AddrMan and later request them by sending getaddr messages. // Making nodes which are behind NAT and can only make outgoing connections ignore // the getaddr message mitigates the attack. - else if ((strCommand == "getaddr") && (pfrom->fInbound)) + else if ((strCommand == NetMsgType::GETADDR) && (pfrom->fInbound)) { pfrom->vAddrToSend.clear(); vector vAddr = addrman.GetAddr(); @@ -4980,8 +5148,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "mempool") + else if (strCommand == NetMsgType::MEMPOOL) { + if (CNode::OutboundTargetReached(false) && !pfrom->fWhitelisted) + { + LogPrint("net", "mempool request with bandwidth limit reached, disconnect peer=%d\n", pfrom->GetId()); + pfrom->fDisconnect = true; + return true; + } LOCK2(cs_main, pfrom->cs_filter); std::vector vtxid; @@ -4989,23 +5163,24 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, vector vInv; BOOST_FOREACH(uint256& hash, vtxid) { CInv inv(MSG_TX, hash); - CTransaction tx; - bool fInMemPool = mempool.lookup(hash, tx); - if (!fInMemPool) continue; // another thread removed since queryHashes, maybe... - if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(tx)) || - (!pfrom->pfilter)) - vInv.push_back(inv); + if (pfrom->pfilter) { + CTransaction tx; + bool fInMemPool = mempool.lookup(hash, tx); + if (!fInMemPool) continue; // another thread removed since queryHashes, maybe... + if (!pfrom->pfilter->IsRelevantAndUpdate(tx)) continue; + } + vInv.push_back(inv); if (vInv.size() == MAX_INV_SZ) { - pfrom->PushMessage("inv", vInv); + pfrom->PushMessage(NetMsgType::INV, vInv); vInv.clear(); } } if (vInv.size() > 0) - pfrom->PushMessage("inv", vInv); + pfrom->PushMessage(NetMsgType::INV, vInv); } - else if (strCommand == "ping") + else if (strCommand == NetMsgType::PING) { if (pfrom->nVersion > BIP0031_VERSION) { @@ -5022,12 +5197,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, // it, if the remote node sends a ping once per second and this node takes 5 // seconds to respond to each, the 5th ping the remote sends would appear to // return very quickly. - pfrom->PushMessage("pong", nonce); + pfrom->PushMessage(NetMsgType::PONG, nonce); } } - else if (strCommand == "pong") + else if (strCommand == NetMsgType::PONG) { int64_t pingUsecEnd = nTimeReceived; uint64_t nonce = 0; @@ -5084,7 +5259,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (fAlerts && strCommand == "alert") + else if (fAlerts && strCommand == NetMsgType::ALERT) { CAlert alert; vRecv >> alert; @@ -5115,7 +5290,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "filterload") + else if (strCommand == NetMsgType::FILTERLOAD) { CBloomFilter filter; vRecv >> filter; @@ -5134,7 +5309,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "filteradd") + else if (strCommand == NetMsgType::FILTERADD) { vector vData; vRecv >> vData; @@ -5154,7 +5329,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "filterclear") + else if (strCommand == NetMsgType::FILTERCLEAR) { LOCK(pfrom->cs_filter); delete pfrom->pfilter; @@ -5163,7 +5338,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } - else if (strCommand == "reject") + else if (strCommand == NetMsgType::REJECT) { if (fDebug) { try { @@ -5173,7 +5348,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, ostringstream ss; ss << strMsg << " code " << itostr(ccode) << ": " << strReason; - if (strMsg == "block" || strMsg == "tx") + if (strMsg == NetMsgType::BLOCK || strMsg == NetMsgType::TX) { uint256 hash; vRecv >> hash; @@ -5281,7 +5456,7 @@ bool ProcessMessages(CNode* pfrom) } catch (const std::ios_base::failure& e) { - pfrom->PushMessage("reject", strCommand, REJECT_MALFORMED, string("error parsing message")); + pfrom->PushMessage(NetMsgType::REJECT, strCommand, REJECT_MALFORMED, string("error parsing message")); if (strstr(e.what(), "end of data")) { // Allow exceptions from under-length message on vRecv @@ -5320,7 +5495,7 @@ bool ProcessMessages(CNode* pfrom) } -bool SendMessages(CNode* pto, bool fSendTrickle) +bool SendMessages(CNode* pto) { const Consensus::Params& consensusParams = Params().GetConsensus(); { @@ -5349,11 +5524,11 @@ bool SendMessages(CNode* pto, bool fSendTrickle) pto->nPingUsecStart = GetTimeMicros(); if (pto->nVersion > BIP0031_VERSION) { pto->nPingNonceSent = nonce; - pto->PushMessage("ping", nonce); + pto->PushMessage(NetMsgType::PING, nonce); } else { // Peer is too old to support ping command with nonce, pong will never arrive. pto->nPingNonceSent = 0; - pto->PushMessage("ping"); + pto->PushMessage(NetMsgType::PING); } } @@ -5362,28 +5537,17 @@ bool SendMessages(CNode* pto, bool fSendTrickle) return true; // Address refresh broadcast - static int64_t nLastRebroadcast; - if (!IsInitialBlockDownload() && (GetTime() - nLastRebroadcast > 24 * 60 * 60)) - { - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - { - // Periodically clear addrKnown to allow refresh broadcasts - if (nLastRebroadcast) - pnode->addrKnown.reset(); - - // Rebroadcast our address - AdvertizeLocal(pnode); - } - if (!vNodes.empty()) - nLastRebroadcast = GetTime(); + int64_t nNow = GetTimeMicros(); + if (!IsInitialBlockDownload() && pto->nNextLocalAddrSend < nNow) { + AdvertizeLocal(pto); + pto->nNextLocalAddrSend = PoissonNextSend(nNow, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL); } // // Message: addr // - if (fSendTrickle) - { + if (pto->nNextAddrSend < nNow) { + pto->nNextAddrSend = PoissonNextSend(nNow, AVG_ADDRESS_BROADCAST_INTERVAL); vector vAddr; vAddr.reserve(pto->vAddrToSend.size()); BOOST_FOREACH(const CAddress& addr, pto->vAddrToSend) @@ -5395,14 +5559,14 @@ bool SendMessages(CNode* pto, bool fSendTrickle) // receiver rejects addr messages larger than 1000 if (vAddr.size() >= 1000) { - pto->PushMessage("addr", vAddr); + pto->PushMessage(NetMsgType::ADDR, vAddr); vAddr.clear(); } } } pto->vAddrToSend.clear(); if (!vAddr.empty()) - pto->PushMessage("addr", vAddr); + pto->PushMessage(NetMsgType::ADDR, vAddr); } CNodeState &state = *State(pto->GetId()); @@ -5422,7 +5586,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) } BOOST_FOREACH(const CBlockReject& reject, state.rejects) - pto->PushMessage("reject", (string)"block", reject.chRejectCode, reject.strRejectReason, reject.hashBlock); + pto->PushMessage(NetMsgType::REJECT, (string)NetMsgType::BLOCK, reject.chRejectCode, reject.strRejectReason, reject.hashBlock); state.rejects.clear(); // Start block sync @@ -5445,7 +5609,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) if (pindexStart->pprev) pindexStart = pindexStart->pprev; LogPrint("net", "initial getheaders (%d) to peer=%d (startheight:%d)\n", pindexStart->nHeight, pto->id, pto->nStartingHeight); - pto->PushMessage("getheaders", chainActive.GetLocator(pindexStart), uint256()); + pto->PushMessage(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexStart), uint256()); } } @@ -5545,7 +5709,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) LogPrint("net", "%s: sending header %s to peer=%d\n", __func__, vHeaders.front().GetHash().ToString(), pto->id); } - pto->PushMessage("headers", vHeaders); + pto->PushMessage(NetMsgType::HEADERS, vHeaders); state.pindexBestHeaderSent = pBestIndex; } pto->vBlockHashesToAnnounce.clear(); @@ -5557,16 +5721,21 @@ bool SendMessages(CNode* pto, bool fSendTrickle) vector vInv; vector vInvWait; { + bool fSendTrickle = pto->fWhitelisted; + if (pto->nNextInvSend < nNow) { + fSendTrickle = true; + pto->nNextInvSend = PoissonNextSend(nNow, AVG_INVENTORY_BROADCAST_INTERVAL); + } LOCK(pto->cs_inventory); - vInv.reserve(pto->vInventoryToSend.size()); + vInv.reserve(std::min(1000, pto->vInventoryToSend.size())); vInvWait.reserve(pto->vInventoryToSend.size()); BOOST_FOREACH(const CInv& inv, pto->vInventoryToSend) { - if (pto->setInventoryKnown.count(inv)) + if ((inv.type == MSG_TX || inv.type == MSG_WITNESS_TX) && pto->filterInventoryKnown.contains(inv.hash)) continue; // trickle out tx inv to protect privacy - if (inv.type == MSG_TX && !fSendTrickle) + if ((inv.type == MSG_TX || inv.type == MSG_WITNESS_TX) && !fSendTrickle) { // 1/4 of tx invs blast to all immediately static uint256 hashSalt; @@ -5583,24 +5752,22 @@ bool SendMessages(CNode* pto, bool fSendTrickle) } } - // returns true if wasn't already contained in the set - if (pto->setInventoryKnown.insert(inv).second) + pto->filterInventoryKnown.insert(inv.hash); + + vInv.push_back(inv); + if (vInv.size() >= 1000) { - vInv.push_back(inv); - if (vInv.size() >= 1000) - { - pto->PushMessage("inv", vInv); - vInv.clear(); - } + pto->PushMessage(NetMsgType::INV, vInv); + vInv.clear(); } } pto->vInventoryToSend = vInvWait; } if (!vInv.empty()) - pto->PushMessage("inv", vInv); + pto->PushMessage(NetMsgType::INV, vInv); // Detect whether we're stalling - int64_t nNow = GetTimeMicros(); + nNow = GetTimeMicros(); if (!pto->fDisconnect && state.nStallingSince && state.nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT) { // Stalling only triggers when the block download window cannot move. During normal steady state, // the download window should be much larger than the to-be-downloaded set of blocks, so disconnection @@ -5640,10 +5807,11 @@ bool SendMessages(CNode* pto, bool fSendTrickle) NodeId staller = -1; FindNextBlocksToDownload(pto->GetId(), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight, vToDownload, staller); BOOST_FOREACH(CBlockIndex *pindex, vToDownload) { - vGetData.push_back(CInv(MSG_BLOCK, pindex->GetBlockHash())); - MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), consensusParams, pindex); - LogPrint("net", "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(), - pindex->nHeight, pto->id); + if (State(pto->GetId())->fHaveWitness || !RequireWitness(pindex, consensusParams)) { + vGetData.push_back(CInv(State(pto->GetId())->fHaveWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK, pindex->GetBlockHash())); + MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), consensusParams, pindex); + LogPrint("net", "Requesting block %s (%d) peer=%d\n", pindex->GetBlockHash().ToString(), pindex->nHeight, pto->id); + } } if (state.nBlocksInFlight == 0 && staller != -1) { if (State(staller)->nStallingSince == 0) { @@ -5666,7 +5834,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) vGetData.push_back(inv); if (vGetData.size() >= 1000) { - pto->PushMessage("getdata", vGetData); + pto->PushMessage(NetMsgType::GETDATA, vGetData); vGetData.clear(); } } else { @@ -5676,7 +5844,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) pto->mapAskFor.erase(pto->mapAskFor.begin()); } if (!vGetData.empty()) - pto->PushMessage("getdata", vGetData); + pto->PushMessage(NetMsgType::GETDATA, vGetData); } return true; diff --git a/src/main.h b/src/main.h index 19623f4d96f5a..64ea391f62a48 100644 --- a/src/main.h +++ b/src/main.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -87,6 +87,14 @@ static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60; static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60; /** Maximum length of reject messages. */ static const unsigned int MAX_REJECT_MESSAGE_LENGTH = 111; +/** Average delay between local address broadcasts in seconds. */ +static const unsigned int AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL = 24 * 24 * 60; +/** Average delay between peer address broadcasts in seconds. */ +static const unsigned int AVG_ADDRESS_BROADCAST_INTERVAL = 30; +/** Average delay between trickled inventory broadcasts in seconds. + * Blocks, whitelisted receivers, and a random 25% of transactions bypass this. */ +static const unsigned int AVG_INVENTORY_BROADCAST_INTERVAL = 5; + static const unsigned int DEFAULT_LIMITFREERELAY = 15; static const bool DEFAULT_RELAYPRIORITY = true; @@ -197,9 +205,8 @@ bool ProcessMessages(CNode* pfrom); * Send queued protocol messages to be sent to a give node. * * @param[in] pto The node which we are sending messages to. - * @param[in] fSendTrickle When true send the trickled data, otherwise trickle the data until true. */ -bool SendMessages(CNode* pto, bool fSendTrickle); +bool SendMessages(CNode* pto); /** Run an instance of the script checking thread */ void ThreadScriptCheck(); /** Try to detect Partition (network isolation) attacks against us */ @@ -293,8 +300,6 @@ struct CDiskTxPos : public CDiskBlockPos }; -CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowFree); - /** * Count ECDSA signature operations the old-fashioned (pre-0.6) way * @return number of sigops this transaction's outputs will produce when spent @@ -349,6 +354,7 @@ class CScriptCheck { private: CScript scriptPubKey; + CAmount amount; const CTransaction *ptxTo; unsigned int nIn; unsigned int nFlags; @@ -356,9 +362,9 @@ class CScriptCheck ScriptError error; public: - CScriptCheck(): ptxTo(0), nIn(0), nFlags(0), cacheStore(false), error(SCRIPT_ERR_UNKNOWN_ERROR) {} + CScriptCheck(): amount(0), ptxTo(0), nIn(0), nFlags(0), cacheStore(false), error(SCRIPT_ERR_UNKNOWN_ERROR) {} CScriptCheck(const CCoins& txFromIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn) : - scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), + scriptPubKey(txFromIn.vout[txToIn.vin[nInIn].prevout.n].scriptPubKey), amount(txFromIn.vout[txToIn.vin[nInIn].prevout.n].nValue), ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR) { } bool operator()(); @@ -366,6 +372,7 @@ class CScriptCheck void swap(CScriptCheck &check) { scriptPubKey.swap(check.scriptPubKey); std::swap(ptxTo, check.ptxTo); + std::swap(amount, check.amount); std::swap(nIn, check.nIn); std::swap(nFlags, check.nFlags); std::swap(cacheStore, check.cacheStore); @@ -403,6 +410,10 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn /** Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) */ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true); +/** Produce the necessary coinbase commitment for a block. */ +std::vector GenerateCoinbaseCommitment(const CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams); +CTxWitness GenerateCoinbaseWitness(const CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams); + class CBlockFileInfo { diff --git a/src/merkleblock.cpp b/src/merkleblock.cpp index f8e877df25c90..8447f924e4d55 100644 --- a/src/merkleblock.cpp +++ b/src/merkleblock.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/merkleblock.h b/src/merkleblock.h index 904c22abc2b94..996cd12624fdd 100644 --- a/src/merkleblock.h +++ b/src/merkleblock.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/miner.cpp b/src/miner.cpp index 2728c7e6a722d..bcccb1b81b76f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -137,6 +137,9 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& s pblock->nTime = GetAdjustedTime(); const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); + // Decide whether to include witness transactions (temporary) + bool fIncludeWitness = !GenerateCoinbaseWitness(*pblock, pindexPrev, chainparams.GetConsensus()).IsNull(); + int64_t nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST) ? nMedianTimePast : pblock->GetBlockTime(); @@ -182,6 +185,9 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& s const CTransaction& tx = iter->GetTx(); + if (!fIncludeWitness && !tx.wit.IsNull()) + continue; // cannot accept witness transactions into a non-witness block + bool fOrphan = false; BOOST_FOREACH(CTxMemPool::txiter parent, mempool.GetMemPoolParents(iter)) { @@ -275,9 +281,16 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& s nLastBlockSize = nBlockSize; LogPrintf("CreateNewBlock(): total size %u txs: %u fees: %ld sigops %d\n", nBlockSize, nBlockTx, nFees, nBlockSigOps); + pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus()); + // Compute final coinbase transaction. txNew.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus()); - txNew.vin[0].scriptSig = CScript() << nHeight << OP_0; + txNew.vin[0].scriptSig = CScript() << nHeight; + txNew.wit = GenerateCoinbaseWitness(*pblock, pindexPrev, chainparams.GetConsensus()); + if (!pblocktemplate->vchCoinbaseCommitment.empty()) { + txNew.vin[0].scriptSig << pblocktemplate->vchCoinbaseCommitment; + } + txNew.vin[0].scriptSig << OP_0; pblock->vtx[0] = txNew; pblocktemplate->vTxFees[0] = -nFees; @@ -297,7 +310,7 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& s return pblocktemplate.release(); } -void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce) +void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce, const std::vector vchCoinbaseCommitment) { // Update nExtraNonce static uint256 hashPrevBlock; @@ -309,7 +322,7 @@ void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned ++nExtraNonce; unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2 CMutableTransaction txCoinbase(pblock->vtx[0]); - txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS; + txCoinbase.vin[0].scriptSig = (CScript() << nHeight << vchCoinbaseCommitment << CScriptNum(nExtraNonce)) + COINBASE_FLAGS; assert(txCoinbase.vin[0].scriptSig.size() <= 100); pblock->vtx[0] = txCoinbase; @@ -424,7 +437,7 @@ void static BitcoinMiner(const CChainParams& chainparams) return; } CBlock *pblock = &pblocktemplate->block; - IncrementExtraNonce(pblock, pindexPrev, nExtraNonce); + IncrementExtraNonce(pblock, pindexPrev, nExtraNonce, pblocktemplate->vchCoinbaseCommitment); LogPrintf("Running BitcoinMiner with %u transactions in block (%u bytes)\n", pblock->vtx.size(), ::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); diff --git a/src/miner.h b/src/miner.h index 16c8e2a976f13..7e6fd41e73624 100644 --- a/src/miner.h +++ b/src/miner.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -27,6 +27,7 @@ struct CBlockTemplate CBlock block; std::vector vTxFees; std::vector vTxSigOps; + std::vector vchCoinbaseCommitment; }; /** Run the miner threads */ @@ -34,7 +35,7 @@ void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainpar /** Generate a new block, without valid proof-of-work */ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const CScript& scriptPubKeyIn); /** Modify the extranonce in a block */ -void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce); +void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce, const std::vector vchCoinbaseCommitment); int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev); #endif // BITCOIN_MINER_H diff --git a/src/mruset.h b/src/mruset.h deleted file mode 100644 index 398aa173bf1e3..0000000000000 --- a/src/mruset.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2012-2015 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_MRUSET_H -#define BITCOIN_MRUSET_H - -#include -#include -#include - -/** STL-like set container that only keeps the most recent N elements. */ -template -class mruset -{ -public: - typedef T key_type; - typedef T value_type; - typedef typename std::set::iterator iterator; - typedef typename std::set::const_iterator const_iterator; - typedef typename std::set::size_type size_type; - -protected: - std::set set; - std::vector order; - size_type first_used; - size_type first_unused; - const size_type nMaxSize; - -public: - mruset(size_type nMaxSizeIn = 1) : nMaxSize(nMaxSizeIn) { clear(); } - iterator begin() const { return set.begin(); } - iterator end() const { return set.end(); } - size_type size() const { return set.size(); } - bool empty() const { return set.empty(); } - iterator find(const key_type& k) const { return set.find(k); } - size_type count(const key_type& k) const { return set.count(k); } - void clear() - { - set.clear(); - order.assign(nMaxSize, set.end()); - first_used = 0; - first_unused = 0; - } - bool inline friend operator==(const mruset& a, const mruset& b) { return a.set == b.set; } - bool inline friend operator==(const mruset& a, const std::set& b) { return a.set == b; } - bool inline friend operator<(const mruset& a, const mruset& b) { return a.set < b.set; } - std::pair insert(const key_type& x) - { - std::pair ret = set.insert(x); - if (ret.second) { - if (set.size() == nMaxSize + 1) { - set.erase(order[first_used]); - order[first_used] = set.end(); - if (++first_used == nMaxSize) first_used = 0; - } - order[first_unused] = ret.first; - if (++first_unused == nMaxSize) first_unused = 0; - } - return ret; - } - size_type max_size() const { return nMaxSize; } -}; - -#endif // BITCOIN_MRUSET_H diff --git a/src/net.cpp b/src/net.cpp index e5659efc01d7f..534d46ad60762 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -36,6 +36,8 @@ #include #include +#include + // Dump addresses to peers.dat every 15 minutes (900s) #define DUMP_ADDRESSES_INTERVAL 900 @@ -67,6 +69,8 @@ namespace { }; } +const static std::string NET_MESSAGE_COMMAND_OTHER = "*other*"; + // // Global state variables // @@ -87,9 +91,9 @@ std::string strSubVersion; vector vNodes; CCriticalSection cs_vNodes; -map mapRelay; -deque > vRelayExpiration; -CCriticalSection cs_mapRelay; +map mapRelayTx; +deque > vRelayTxExpiration; +CCriticalSection cs_mapRelayTx; limitedmap mapAlreadyAskedFor(MAX_INV_SZ); static deque vOneShots; @@ -459,7 +463,7 @@ void CNode::PushVersion() LogPrint("net", "send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), addrYou.ToString(), id); else LogPrint("net", "send version message: version %d, blocks=%d, us=%s, peer=%d\n", PROTOCOL_VERSION, nBestHeight, addrMe.ToString(), id); - PushMessage("version", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, + PushMessage(NetMsgType::VERSION, PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe, nLocalHostNonce, strSubVersion, nBestHeight, !GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)); } @@ -627,7 +631,9 @@ void CNode::copyStats(CNodeStats &stats) X(fInbound); X(nStartingHeight); X(nSendBytes); + X(mapSendBytesPerMsgCmd); X(nRecvBytes); + X(mapRecvBytesPerMsgCmd); X(fWhitelisted); // It is common for nodes with good ping times to suddenly become lagged, @@ -682,6 +688,15 @@ bool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes) nBytes -= handled; if (msg.complete()) { + + //store received bytes per message command + //to prevent a memory DOS, only allow valid commands + mapMsgCmdSize::iterator i = mapRecvBytesPerMsgCmd.find(msg.hdr.pchCommand); + if (i == mapRecvBytesPerMsgCmd.end()) + i = mapRecvBytesPerMsgCmd.find(NET_MESSAGE_COMMAND_OTHER); + assert(i != mapRecvBytesPerMsgCmd.end()); + i->second += msg.hdr.nMessageSize + CMessageHeader::HEADER_SIZE; + msg.nTime = GetTimeMicros(); messageHandlerCondition.notify_one(); } @@ -1355,7 +1370,7 @@ void ThreadMapPort() LogPrintf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n", port, port, lanaddr, r, strupnperror(r)); else - LogPrintf("UPnP Port Mapping successful.\n");; + LogPrintf("UPnP Port Mapping successful.\n"); MilliSleep(20*60*1000); // Refresh every 20 minutes } @@ -1720,11 +1735,6 @@ void ThreadMessageHandler() } } - // Poll the connected nodes for messages - CNode* pnodeTrickle = NULL; - if (!vNodesCopy.empty()) - pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())]; - bool fSleep = true; BOOST_FOREACH(CNode* pnode, vNodesCopy) @@ -1755,7 +1765,7 @@ void ThreadMessageHandler() { TRY_LOCK(pnode->cs_vSend, lockSend); if (lockSend) - g_signals.SendMessages(pnode, pnode == pnodeTrickle || pnode->fWhitelisted); + g_signals.SendMessages(pnode); } boost::this_thread::interruption_point(); } @@ -2050,28 +2060,20 @@ instance_of_cnetcleanup; void RelayTransaction(const CTransaction& tx) -{ - CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); - ss.reserve(10000); - ss << tx; - RelayTransaction(tx, ss); -} - -void RelayTransaction(const CTransaction& tx, const CDataStream& ss) { CInv inv(MSG_TX, tx.GetHash()); { - LOCK(cs_mapRelay); + LOCK(cs_mapRelayTx); // Expire old relay messages - while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime()) + while (!vRelayTxExpiration.empty() && vRelayTxExpiration.front().first < GetTime()) { - mapRelay.erase(vRelayExpiration.front().second); - vRelayExpiration.pop_front(); + mapRelayTx.erase(vRelayTxExpiration.front().second); + vRelayTxExpiration.pop_front(); } // Save original serialized message so newer versions are preserved - mapRelay.insert(std::make_pair(inv, ss)); - vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv)); + mapRelayTx.insert(std::make_pair(inv.hash, tx)); + vRelayTxExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv.hash)); } LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) @@ -2342,7 +2344,7 @@ unsigned int SendBufferSize() { return 1000*GetArg("-maxsendbuffer", DEFAULT_MAX CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNameIn, bool fInboundIn) : ssSend(SER_NETWORK, INIT_PROTO_VERSION), addrKnown(5000, 0.001), - setInventoryKnown(SendBufferSize() / 1000) + filterInventoryKnown(50000, 0.000001) { nServices = 0; hSocket = hSocketIn; @@ -2369,7 +2371,11 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa nSendOffset = 0; hashContinue = uint256(); nStartingHeight = -1; + filterInventoryKnown.reset(); fGetAddr = false; + nNextLocalAddrSend = 0; + nNextAddrSend = 0; + nNextInvSend = 0; fRelayTxes = false; pfilter = new CBloomFilter(); nPingNonceSent = 0; @@ -2377,6 +2383,9 @@ CNode::CNode(SOCKET hSocketIn, const CAddress& addrIn, const std::string& addrNa nPingUsecTime = 0; fPingQueued = false; nMinPingUsecTime = std::numeric_limits::max(); + BOOST_FOREACH(const std::string &msg, getAllNetMessageTypes()) + mapRecvBytesPerMsgCmd[msg] = 0; + mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0; { LOCK(cs_nLastNodeId); @@ -2456,7 +2465,7 @@ void CNode::AbortMessage() UNLOCK_FUNCTION(cs_vSend) LogPrint("net", "(aborted)\n"); } -void CNode::EndMessage() UNLOCK_FUNCTION(cs_vSend) +void CNode::EndMessage(const char* pszCommand) UNLOCK_FUNCTION(cs_vSend) { // The -*messagestest options are intentionally not documented in the help message, // since they are only used during development to debug the networking code and are @@ -2479,6 +2488,9 @@ void CNode::EndMessage() UNLOCK_FUNCTION(cs_vSend) unsigned int nSize = ssSend.size() - CMessageHeader::HEADER_SIZE; WriteLE32((uint8_t*)&ssSend[CMessageHeader::MESSAGE_SIZE_OFFSET], nSize); + //log total amount of bytes per command + mapSendBytesPerMsgCmd[std::string(pszCommand)] += nSize + CMessageHeader::HEADER_SIZE; + // Set the checksum uint256 hash = Hash(ssSend.begin() + CMessageHeader::HEADER_SIZE, ssSend.end()); unsigned int nChecksum = 0; @@ -2614,3 +2626,7 @@ void DumpBanlist() LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n", banmap.size(), GetTimeMillis() - nStart); } + +int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds) { + return nNow + (int64_t)(log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */) * average_interval_seconds * -1000000.0 + 0.5); +} diff --git a/src/net.h b/src/net.h index a5a5c770d6445..2f3a841ecaa70 100644 --- a/src/net.h +++ b/src/net.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -9,7 +9,6 @@ #include "bloom.h" #include "compat.h" #include "limitedmap.h" -#include "mruset.h" #include "netbase.h" #include "protocol.h" #include "random.h" @@ -114,7 +113,7 @@ struct CNodeSignals { boost::signals2::signal GetHeight; boost::signals2::signal ProcessMessages; - boost::signals2::signal SendMessages; + boost::signals2::signal SendMessages; boost::signals2::signal InitializeNode; boost::signals2::signal FinalizeNode; }; @@ -162,9 +161,9 @@ extern int nMaxConnections; extern std::vector vNodes; extern CCriticalSection cs_vNodes; -extern std::map mapRelay; -extern std::deque > vRelayExpiration; -extern CCriticalSection cs_mapRelay; +extern std::map mapRelayTx; +extern std::deque > vRelayTxExpiration; +extern CCriticalSection cs_mapRelayTx; extern limitedmap mapAlreadyAskedFor; extern std::vector vAddedNodes; @@ -183,6 +182,7 @@ struct LocalServiceInfo { extern CCriticalSection cs_mapLocalHost; extern std::map mapLocalHost; +typedef std::map mapMsgCmdSize; //command, total bytes class CNodeStats { @@ -200,7 +200,9 @@ class CNodeStats bool fInbound; int nStartingHeight; uint64_t nSendBytes; + mapMsgCmdSize mapSendBytesPerMsgCmd; uint64_t nRecvBytes; + mapMsgCmdSize mapRecvBytesPerMsgCmd; bool fWhitelisted; double dPingTime; double dPingWait; @@ -374,6 +376,9 @@ class CNode static std::vector vWhitelistedRange; static CCriticalSection cs_vWhitelistedRange; + mapMsgCmdSize mapSendBytesPerMsgCmd; + mapMsgCmdSize mapRecvBytesPerMsgCmd; + // Basic fuzz-testing void Fuzz(int nChance); // modifies ssSend @@ -386,13 +391,16 @@ class CNode CRollingBloomFilter addrKnown; bool fGetAddr; std::set setKnown; + int64_t nNextAddrSend; + int64_t nNextLocalAddrSend; // inventory based relay - mruset setInventoryKnown; + CRollingBloomFilter filterInventoryKnown; std::vector vInventoryToSend; CCriticalSection cs_inventory; std::set setAskFor; std::multimap mapAskFor; + int64_t nNextInvSend; // Used for headers announcements - unfiltered blocks to relay // Also protected by cs_inventory std::vector vBlockHashesToAnnounce; @@ -497,7 +505,7 @@ class CNode { { LOCK(cs_inventory); - setInventoryKnown.insert(inv); + filterInventoryKnown.insert(inv.hash); } } @@ -505,8 +513,9 @@ class CNode { { LOCK(cs_inventory); - if (!setInventoryKnown.count(inv)) - vInventoryToSend.push_back(inv); + if ((inv.type == MSG_TX || inv.type == MSG_WITNESS_TX) && filterInventoryKnown.contains(inv.hash)) + return; + vInventoryToSend.push_back(inv); } } @@ -525,7 +534,7 @@ class CNode void AbortMessage() UNLOCK_FUNCTION(cs_vSend); // TODO: Document the precondition of this function. Is cs_vSend locked? - void EndMessage() UNLOCK_FUNCTION(cs_vSend); + void EndMessage(const char* pszCommand) UNLOCK_FUNCTION(cs_vSend); void PushVersion(); @@ -535,7 +544,7 @@ class CNode try { BeginMessage(pszCommand); - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -551,7 +560,24 @@ class CNode { BeginMessage(pszCommand); ssSend << a1; - EndMessage(); + EndMessage(pszCommand); + } + catch (...) + { + AbortMessage(); + throw; + } + } + + /** Send a message containing a1, serialized with flag flag. */ + template + void PushMessageWithFlag(int flag, const char* pszCommand, const T1& a1) + { + try + { + BeginMessage(pszCommand); + WithOrVersion(&ssSend, flag) << a1; + EndMessage(pszCommand); } catch (...) { @@ -567,7 +593,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -583,7 +609,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -599,7 +625,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3 << a4; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -615,7 +641,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3 << a4 << a5; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -631,7 +657,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3 << a4 << a5 << a6; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -647,7 +673,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3 << a4 << a5 << a6 << a7; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -663,7 +689,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3 << a4 << a5 << a6 << a7 << a8; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -679,7 +705,7 @@ class CNode { BeginMessage(pszCommand); ssSend << a1 << a2 << a3 << a4 << a5 << a6 << a7 << a8 << a9; - EndMessage(); + EndMessage(pszCommand); } catch (...) { @@ -759,7 +785,6 @@ class CNode class CTransaction; void RelayTransaction(const CTransaction& tx); -void RelayTransaction(const CTransaction& tx, const CDataStream& ss); /** Access to the (IP) address database (peers.dat) */ class CAddrDB @@ -785,4 +810,7 @@ class CBanDB void DumpBanlist(); +/** Return a timestamp in the future (in microseconds) for exponentially distributed events. */ +int64_t PoissonNextSend(int64_t nNow, int average_interval_seconds); + #endif // BITCOIN_NET_H diff --git a/src/netbase.cpp b/src/netbase.cpp index 05214cb026fe5..4e1f267607099 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/netbase.h b/src/netbase.h index 9c2df0338e20a..1db66ac27f2da 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp index 46c7f18942540..47ae1b85d6af1 100644 --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin developers +// Copyright (c) 2009-2015 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -146,7 +146,7 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs) // IsStandardTx() will have already returned false // and this method isn't called. std::vector > stack; - if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker())) + if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker(), 0)) return false; if (whichType == TX_SCRIPTHASH) diff --git a/src/policy/policy.h b/src/policy/policy.h index 31655f2f3a2f6..80043a1901a47 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin developers +// Copyright (c) 2009-2015 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -40,7 +40,9 @@ static const unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS | SCRIPT_VERIFY_CLEANSTACK | SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | - SCRIPT_VERIFY_LOW_S; + SCRIPT_VERIFY_LOW_S | + SCRIPT_VERIFY_WITNESS | + SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM; /** For convenience, standard but not mandatory verify flags. */ static const unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; diff --git a/src/pow.cpp b/src/pow.cpp index 5ace3fbc9b5bc..7392defe64b82 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/pow.h b/src/pow.h index e864a474ccd69..4399440929b47 100644 --- a/src/pow.h +++ b/src/pow.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index 7280c18f7766a..71b1dff89945b 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -31,3 +31,12 @@ std::string CBlock::ToString() const } return s.str(); } + +size_t GetVirtualBlockSize(const CBlock& block) +{ + // The formula is: vsize = base_size + witness_size / 4. + // We can only serialize base or totalbase+witness, however, so the formula + // becomes: vsize = base_size + (total_size - base_size) / 4 or + // vsize = (total_size + 3 * base_size) / 4. + return (::GetSerializeSize(block, SER_NETWORK, 0) * 3 + ::GetSerializeSize(block, SER_NETWORK, SERIALIZE_TRANSACTION_WITNESS) + 3) / 4; +} diff --git a/src/primitives/block.h b/src/primitives/block.h index 5c017d436f50e..44ae695c5509d 100644 --- a/src/primitives/block.h +++ b/src/primitives/block.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -21,7 +21,7 @@ class CBlockHeader { public: // header - static const int32_t CURRENT_VERSION=4; + static const int32_t CURRENT_VERSION=5; int32_t nVersion; uint256 hashPrevBlock; uint256 hashMerkleRoot; @@ -39,7 +39,6 @@ class CBlockHeader template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(this->nVersion); - nVersion = this->nVersion; READWRITE(hashPrevBlock); READWRITE(hashMerkleRoot); READWRITE(nTime); @@ -121,7 +120,6 @@ class CBlock : public CBlockHeader std::string ToString() const; }; - /** Describes a place in the block chain to another node such that if the * other node doesn't have the same branch, it can find a recent common trunk. * The further back it is, the further before the fork it may be. @@ -157,4 +155,7 @@ struct CBlockLocator } }; +/** Compute the consensus-critical virtual block size. */ +size_t GetVirtualBlockSize(const CBlock& tx); + #endif // BITCOIN_PRIMITIVES_BLOCK_H diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 46d3cbbe2e8ab..01a344006ece3 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -60,21 +60,26 @@ std::string CTxOut::ToString() const } CMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} -CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) {} +CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), wit(tx.wit), nLockTime(tx.nLockTime) {} uint256 CMutableTransaction::GetHash() const { - return SerializeHash(*this); + return SerializeHash(*this, SER_GETHASH, 0); } void CTransaction::UpdateHash() const { - *const_cast(&hash) = SerializeHash(*this); + *const_cast(&hash) = SerializeHash(*this, SER_GETHASH, 0); +} + +uint256 CTransaction::GetWitnessHash() const +{ + return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_WITNESS); } CTransaction::CTransaction() : nVersion(CTransaction::CURRENT_VERSION), vin(), vout(), nLockTime(0) { } -CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) { +CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), wit(tx.wit), nLockTime(tx.nLockTime) { UpdateHash(); } @@ -82,6 +87,7 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) { *const_cast(&nVersion) = tx.nVersion; *const_cast*>(&vin) = tx.vin; *const_cast*>(&vout) = tx.vout; + *const_cast(&wit) = tx.wit; *const_cast(&nLockTime) = tx.nLockTime; *const_cast(&hash) = tx.hash; return *this; @@ -136,7 +142,14 @@ std::string CTransaction::ToString() const nLockTime); for (unsigned int i = 0; i < vin.size(); i++) str += " " + vin[i].ToString() + "\n"; + for (unsigned int i = 0; i < wit.vtxinwit.size(); i++) + str += " " + wit.vtxinwit[i].scriptWitness.ToString() + "\n"; for (unsigned int i = 0; i < vout.size(); i++) str += " " + vout[i].ToString() + "\n"; return str; } + +size_t GetVirtualTransactionSize(const CTransaction& tx) +{ + return (::GetSerializeSize(tx, SER_NETWORK, 0) * 3 + ::GetSerializeSize(tx, SER_NETWORK, SERIALIZE_TRANSACTION_WITNESS) + 3) / 4; +} diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index c5d8a64a6d6ab..e2f4fc641c0a9 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -11,6 +11,8 @@ #include "serialize.h" #include "uint256.h" +static const int SERIALIZE_TRANSACTION_WITNESS = 0x40000000; + /** An outpoint - a combination of a transaction hash and an index n into its vout */ class COutPoint { @@ -171,8 +173,134 @@ class CTxOut std::string ToString() const; }; +class CTxinWitness +{ +public: + CScriptWitness scriptWitness; + + ADD_SERIALIZE_METHODS; + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) + { + READWRITE(scriptWitness.stack); + } + + bool IsNull() const { return scriptWitness.IsNull(); } + + CTxinWitness() { } +}; + +class CTxWitness +{ +public: + /** In case vtxinwit is missing, all entries are treated as if they were empty CTxInWitnesses */ + std::vector vtxinwit; + + ADD_SERIALIZE_METHODS; + + bool IsEmpty() const { return vtxinwit.empty(); } + + bool IsNull() const + { + for (size_t n = 0; n < vtxinwit.size(); n++) { + if (!vtxinwit[n].IsNull()) { + return false; + } + } + return true; + } + + void SetNull() + { + vtxinwit.clear(); + } + + template + inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) + { + for (size_t n = 0; n < vtxinwit.size(); n++) { + READWRITE(vtxinwit[n]); + } + if (IsNull()) { + /* It's illegal to encode a witness when all vtxinwit entries are empty. */ + throw std::ios_base::failure("Superfluous witness record"); + } + } +}; + struct CMutableTransaction; +/** + * Basic transaction serialization format: + * - int32_t nVersion + * - std::vector vin + * - std::vector vout + * - uint32_t nLockTime + * + * Extended transaction serialization format: + * - int32_t nVersion + * - unsigned char dummy = 0x00 + * - unsigned char flags (!= 0) + * - std::vector vin + * - std::vector vout + * - if (flags & 1): + * - CTxWitness wit; + * - uint32_t nLockTime + */ +template +inline void SerializeTransaction(TxType& tx, Stream& s, Operation ser_action, int nType, int nVersion) { + READWRITE(*const_cast(&tx.nVersion)); + unsigned char flags = 0; + if (ser_action.ForRead()) { + /* Try to read the vin. In case the dummy is there, this will be read as an empty vector. */ + READWRITE(*const_cast*>(&tx.vin)); + if (tx.vin.size() == 0) { + /* We read a dummy or an empty vin. */ + READWRITE(flags); + if (flags != 0) { + /* Assume we read a dummy and a flag. */ + READWRITE(*const_cast*>(&tx.vin)); + READWRITE(*const_cast*>(&tx.vout)); + } + } else { + /* We read a non-empty vin. Assume a normal vout follows. */ + READWRITE(*const_cast*>(&tx.vout)); + } + const_cast(&tx.wit)->SetNull(); + if ((flags & 1) && (nVersion & SERIALIZE_TRANSACTION_WITNESS)) { + /* The witness flag is present, and we support witnesses. */ + flags ^= 1; + const_cast(&tx.wit)->vtxinwit.resize(tx.vin.size()); + READWRITE(tx.wit); + } + if (flags) { + /* Unknown flag in the serialization */ + throw std::ios_base::failure("Unknown transaction optional data"); + } + } else { + if (nVersion & SERIALIZE_TRANSACTION_WITNESS) { + /* Check whether witnesses need to be serialized. */ + if (!tx.wit.IsNull()) { + flags |= 1; + } + } + if (flags) { + /* Use extended format in case witnesses are to be serialized. */ + std::vector vinDummy; + READWRITE(vinDummy); + READWRITE(flags); + } + READWRITE(*const_cast*>(&tx.vin)); + READWRITE(*const_cast*>(&tx.vout)); + if (flags & 1) { + const_cast(&tx.wit)->vtxinwit.resize(tx.vin.size()); + READWRITE(tx.wit); + } + } + READWRITE(*const_cast(&tx.nLockTime)); +} + /** The basic transaction that is broadcasted on the network and contained in * blocks. A transaction can contain multiple inputs and outputs. */ @@ -194,6 +322,7 @@ class CTransaction const int32_t nVersion; const std::vector vin; const std::vector vout; + CTxWitness wit; const uint32_t nLockTime; /** Construct a CTransaction that qualifies as IsNull() */ @@ -208,13 +337,10 @@ class CTransaction template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(*const_cast(&this->nVersion)); - nVersion = this->nVersion; - READWRITE(*const_cast*>(&vin)); - READWRITE(*const_cast*>(&vout)); - READWRITE(*const_cast(&nLockTime)); - if (ser_action.ForRead()) + SerializeTransaction(*this, s, ser_action, nType, nVersion); + if (ser_action.ForRead()) { UpdateHash(); + } } bool IsNull() const { @@ -225,6 +351,9 @@ class CTransaction return hash; } + // Compute a hash that includes both transaction and witness data + uint256 GetWitnessHash() const; + // Return sum of txouts. CAmount GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because @@ -260,6 +389,7 @@ struct CMutableTransaction int32_t nVersion; std::vector vin; std::vector vout; + CTxWitness wit; uint32_t nLockTime; CMutableTransaction(); @@ -269,11 +399,7 @@ struct CMutableTransaction template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - READWRITE(this->nVersion); - nVersion = this->nVersion; - READWRITE(vin); - READWRITE(vout); - READWRITE(nLockTime); + SerializeTransaction(*this, s, ser_action, nType, nVersion); } /** Compute the hash of this CMutableTransaction. This is computed on the @@ -282,4 +408,7 @@ struct CMutableTransaction uint256 GetHash() const; }; +/** Compute the consensus-critical virtual transaction size. */ +size_t GetVirtualTransactionSize(const CTransaction& tx); + #endif // BITCOIN_PRIMITIVES_TRANSACTION_H diff --git a/src/protocol.cpp b/src/protocol.cpp index dd855aa33aa92..1d3010119af51 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -12,13 +12,71 @@ # include #endif +namespace NetMsgType { +const char *VERSION="version"; +const char *VERACK="verack"; +const char *ADDR="addr"; +const char *INV="inv"; +const char *GETDATA="getdata"; +const char *MERKLEBLOCK="merkleblock"; +const char *GETBLOCKS="getblocks"; +const char *GETHEADERS="getheaders"; +const char *TX="tx"; +const char *HEADERS="headers"; +const char *BLOCK="block"; +const char *GETADDR="getaddr"; +const char *MEMPOOL="mempool"; +const char *PING="ping"; +const char *PONG="pong"; +const char *ALERT="alert"; +const char *NOTFOUND="notfound"; +const char *FILTERLOAD="filterload"; +const char *FILTERADD="filteradd"; +const char *FILTERCLEAR="filterclear"; +const char *REJECT="reject"; +const char *SENDHEADERS="sendheaders"; +const char *HAVEWITNESS="havewitness"; +}; + static const char* ppszTypeName[] = { - "ERROR", - "tx", - "block", - "filtered block" + "ERROR", // Should never occur + NetMsgType::TX, + NetMsgType::BLOCK, + "filtered block", // Should never occur + "witness block", + "witness tx", +}; + +/** All known message types. Keep this in the same order as the list of + * messages above and in protocol.h. + */ +const static std::string allNetMessageTypes[] = { + NetMsgType::VERSION, + NetMsgType::VERACK, + NetMsgType::ADDR, + NetMsgType::INV, + NetMsgType::GETDATA, + NetMsgType::MERKLEBLOCK, + NetMsgType::GETBLOCKS, + NetMsgType::GETHEADERS, + NetMsgType::TX, + NetMsgType::HEADERS, + NetMsgType::BLOCK, + NetMsgType::GETADDR, + NetMsgType::MEMPOOL, + NetMsgType::PING, + NetMsgType::PONG, + NetMsgType::ALERT, + NetMsgType::NOTFOUND, + NetMsgType::FILTERLOAD, + NetMsgType::FILTERADD, + NetMsgType::FILTERCLEAR, + NetMsgType::REJECT, + NetMsgType::SENDHEADERS, + NetMsgType::HAVEWITNESS, }; +const static std::vector allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes)); CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn) { @@ -140,3 +198,8 @@ std::string CInv::ToString() const { return strprintf("%s %s", GetCommand(), hash.ToString()); } + +const std::vector &getAllNetMessageTypes() +{ + return allNetMessageTypesVec; +} diff --git a/src/protocol.h b/src/protocol.h index 50aeaf44bab19..ffef7c82b247a 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -65,6 +65,170 @@ class CMessageHeader unsigned int nChecksum; }; +/** + * Bitcoin protocol message types. When adding new message types, don't forget + * to update allNetMessageTypes in protocol.cpp. + */ +namespace NetMsgType { + +/** + * The version message provides information about the transmitting node to the + * receiving node at the beginning of a connection. + * @see https://bitcoin.org/en/developer-reference#version + */ +extern const char *VERSION; +/** + * The verack message acknowledges a previously-received version message, + * informing the connecting node that it can begin to send other messages. + * @see https://bitcoin.org/en/developer-reference#verack + */ +extern const char *VERACK; +/** + * The addr (IP address) message relays connection information for peers on the + * network. + * @see https://bitcoin.org/en/developer-reference#addr + */ +extern const char *ADDR; +/** + * The inv message (inventory message) transmits one or more inventories of + * objects known to the transmitting peer. + * @see https://bitcoin.org/en/developer-reference#inv + */ +extern const char *INV; +/** + * The getdata message requests one or more data objects from another node. + * @see https://bitcoin.org/en/developer-reference#getdata + */ +extern const char *GETDATA; +/** + * The merkleblock message is a reply to a getdata message which requested a + * block using the inventory type MSG_MERKLEBLOCK. + * @since protocol version 70001 as described by BIP37. + * @see https://bitcoin.org/en/developer-reference#merkleblock + */ +extern const char *MERKLEBLOCK; +/** + * The getblocks message requests an inv message that provides block header + * hashes starting from a particular point in the block chain. + * @see https://bitcoin.org/en/developer-reference#getblocks + */ +extern const char *GETBLOCKS; +/** + * The getheaders message requests a headers message that provides block + * headers starting from a particular point in the block chain. + * @since protocol version 31800. + * @see https://bitcoin.org/en/developer-reference#getheaders + */ +extern const char *GETHEADERS; +/** + * The tx message transmits a single transaction. + * @see https://bitcoin.org/en/developer-reference#tx + */ +extern const char *TX; +/** + * The headers message sends one or more block headers to a node which + * previously requested certain headers with a getheaders message. + * @since protocol version 31800. + * @see https://bitcoin.org/en/developer-reference#headers + */ +extern const char *HEADERS; +/** + * The block message transmits a single serialized block. + * @see https://bitcoin.org/en/developer-reference#block + */ +extern const char *BLOCK; +/** + * The getaddr message requests an addr message from the receiving node, + * preferably one with lots of IP addresses of other receiving nodes. + * @see https://bitcoin.org/en/developer-reference#getaddr + */ +extern const char *GETADDR; +/** + * The mempool message requests the TXIDs of transactions that the receiving + * node has verified as valid but which have not yet appeared in a block. + * @since protocol version 60002. + * @see https://bitcoin.org/en/developer-reference#mempool + */ +extern const char *MEMPOOL; +/** + * The ping message is sent periodically to help confirm that the receiving + * peer is still connected. + * @see https://bitcoin.org/en/developer-reference#ping + */ +extern const char *PING; +/** + * The pong message replies to a ping message, proving to the pinging node that + * the ponging node is still alive. + * @since protocol version 60001 as described by BIP31. + * @see https://bitcoin.org/en/developer-reference#pong + */ +extern const char *PONG; +/** + * The alert message warns nodes of problems that may affect them or the rest + * of the network. + * @since protocol version 311. + * @see https://bitcoin.org/en/developer-reference#alert + */ +extern const char *ALERT; +/** + * The notfound message is a reply to a getdata message which requested an + * object the receiving node does not have available for relay. + * @ince protocol version 70001. + * @see https://bitcoin.org/en/developer-reference#notfound + */ +extern const char *NOTFOUND; +/** + * The filterload message tells the receiving peer to filter all relayed + * transactions and requested merkle blocks through the provided filter. + * @since protocol version 70001 as described by BIP37. + * Only available with service bit NODE_BLOOM since protocol version + * 70011 as described by BIP111. + * @see https://bitcoin.org/en/developer-reference#filterload + */ +extern const char *FILTERLOAD; +/** + * The filteradd message tells the receiving peer to add a single element to a + * previously-set bloom filter, such as a new public key. + * @since protocol version 70001 as described by BIP37. + * Only available with service bit NODE_BLOOM since protocol version + * 70011 as described by BIP111. + * @see https://bitcoin.org/en/developer-reference#filteradd + */ +extern const char *FILTERADD; +/** + * The filterclear message tells the receiving peer to remove a previously-set + * bloom filter. + * @since protocol version 70001 as described by BIP37. + * Only available with service bit NODE_BLOOM since protocol version + * 70011 as described by BIP111. + * @see https://bitcoin.org/en/developer-reference#filterclear + */ +extern const char *FILTERCLEAR; +/** + * The reject message informs the receiving node that one of its previous + * messages has been rejected. + * @since protocol version 70002 as described by BIP61. + * @see https://bitcoin.org/en/developer-reference#reject + */ +extern const char *REJECT; +/** + * Indicates that a node prefers to receive new block announcements via a + * "headers" message rather than an "inv". + * @since protocol version 70012 as described by BIP130. + * @see https://bitcoin.org/en/developer-reference#sendheaders + */ +extern const char *SENDHEADERS; +/** + * Indicates that a node can be asked for blocks and transactions including + * witness data. + */ +extern const char *HAVEWITNESS; + +}; + +/* Get a vector of all valid message types (see above) */ +const std::vector &getAllNetMessageTypes(); + /** nServices flags */ enum { // NODE_NETWORK means that the node is capable of serving the block chain. It is currently @@ -154,9 +318,13 @@ class CInv enum { MSG_TX = 1, MSG_BLOCK, - // Nodes may always request a MSG_FILTERED_BLOCK in a getdata, however, - // MSG_FILTERED_BLOCK should not appear in any invs except as a part of getdata. + // The following can only occur in getdata. Invs always use TX or BLOCK. MSG_FILTERED_BLOCK, + MSG_WITNESS_BLOCK, + MSG_WITNESS_TX, }; +const uint32_t MSG_WITNESS_FLAG = 1 << 31; +const uint32_t MSG_TYPE_MASK = 0xffffffff >> 1; // Only one flag for now + #endif // BITCOIN_PROTOCOL_H diff --git a/src/pubkey.cpp b/src/pubkey.cpp index 6ebb152c75cf0..db06a8928567f 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/pubkey.h b/src/pubkey.h index a1d437e706e5c..e1a17b658261b 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 8bd158644604f..135f15ffa85ad 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h index 92e6cab9acbc9..c22566d473729 100644 --- a/src/qt/addressbookpage.h +++ b/src/qt/addressbookpage.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp index a488d298c46a7..71ed3618e415e 100644 --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/addresstablemodel.h b/src/qt/addresstablemodel.h index 2b7475c4e2997..d04b95ebaeb36 100644 --- a/src/qt/addresstablemodel.h +++ b/src/qt/addresstablemodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 441814ff07130..680751bb6ac0e 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/askpassphrasedialog.h b/src/qt/askpassphrasedialog.h index d4d832825a382..727b5a1ada18a 100644 --- a/src/qt/askpassphrasedialog.h +++ b/src/qt/askpassphrasedialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp index 33792af5baef8..d95106b5ac87a 100644 --- a/src/qt/bantablemodel.cpp +++ b/src/qt/bantablemodel.cpp @@ -103,7 +103,7 @@ int BanTableModel::rowCount(const QModelIndex &parent) const int BanTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return columns.length();; + return columns.length(); } QVariant BanTableModel::data(const QModelIndex &index, int role) const @@ -178,4 +178,4 @@ bool BanTableModel::shouldShow() if (priv->size() > 0) return true; return false; -} \ No newline at end of file +} diff --git a/src/qt/bantablemodel.h b/src/qt/bantablemodel.h index c21dd04e311cb..fe9600ac0bdec 100644 --- a/src/qt/bantablemodel.h +++ b/src/qt/bantablemodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 6e6330d2a4e38..dcf752cc3291e 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bitcoinamountfield.cpp b/src/qt/bitcoinamountfield.cpp index d19b9fd4afa64..73eb35a54e56b 100644 --- a/src/qt/bitcoinamountfield.cpp +++ b/src/qt/bitcoinamountfield.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index 3703b1f8d7364..2f03a3d1713a8 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index b2bd167aeaf0d..701c96d06fa6c 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index b121a443e7649..871ca1ba347e9 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp index 425b45d9186f5..649005789714f 100644 --- a/src/qt/bitcoinunits.cpp +++ b/src/qt/bitcoinunits.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -111,13 +111,6 @@ QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, Separator } -// TODO: Review all remaining calls to BitcoinUnits::formatWithUnit to -// TODO: determine whether the output is used in a plain text context -// TODO: or an HTML context (and replace with -// TODO: BtcoinUnits::formatHtmlWithUnit in the latter case). Hopefully -// TODO: there aren't instances where the result could be used in -// TODO: either context. - // NOTE: Using formatWithUnit in an HTML context risks wrapping // quantities at the thousands separator. More subtly, it also results // in a standard space rather than a thin space, due to a bug in Qt's diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 1871c33a78b37..fda067b0b83ba 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -88,6 +88,7 @@ class BitcoinUnits: public QAbstractListModel static QString format(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Format as string (with unit) static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); + //! Format as HTML string (with unit) static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard); //! Parse string to coin amount static bool parse(int unit, const QString &value, CAmount *val_out); diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 1271187420fb1..b4ac69639304b 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/clientmodel.h b/src/qt/clientmodel.h index 2d204fdb67d96..62c9f71ac7792 100644 --- a/src/qt/clientmodel.h +++ b/src/qt/clientmodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 0f42243047193..a5c2b6d42151e 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -130,7 +130,7 @@ CoinControlDialog::CoinControlDialog(const PlatformStyle *platformStyle, QWidget ui->treeWidget->setColumnWidth(COLUMN_DATE, 110); ui->treeWidget->setColumnWidth(COLUMN_CONFIRMATIONS, 100); ui->treeWidget->setColumnWidth(COLUMN_PRIORITY, 100); - ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true); // store transacton hash in this column, but don't show it + ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true); // store transaction hash in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_VOUT_INDEX, true); // store vout index in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_AMOUNT_INT64, true); // store amount int64 in this column, but don't show it ui->treeWidget->setColumnHidden(COLUMN_PRIORITY_INT64, true); // store priority int64 in this column, but don't show it @@ -411,7 +411,7 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) // todo: this is a temporary qt5 fix: when clicking a parent node in tree mode, the parent node // including all children are partially selected. But the parent node should be fully selected // as well as the children. Children should never be partially selected in the first place. - // Please remove this ugly fix, once the bug is solved upstream. + // Should be fixed in Qt5.4 and above. https://bugreports.qt.io/browse/QTBUG-43473 #if QT_VERSION >= 0x050000 else if (column == COLUMN_CHECKBOX && item->childCount() > 0) { @@ -637,14 +637,14 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) // tool tips QString toolTip1 = tr("This label turns red if the transaction size is greater than 1000 bytes.") + "

"; - toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000))) + "

"; + toolTip1 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000))) + "

"; toolTip1 += tr("Can vary +/- 1 byte per input."); QString toolTip2 = tr("Transactions with higher priority are more likely to get included into a block.") + "

"; toolTip2 += tr("This label turns red if the priority is smaller than \"medium\".") + "

"; - toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000))); + toolTip2 += tr("This means a fee of at least %1 per kB is required.").arg(BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, CWallet::GetRequiredFee(1000))); - QString toolTip3 = tr("This label turns red if any recipient receives an amount smaller than %1.").arg(BitcoinUnits::formatWithUnit(nDisplayUnit, ::minRelayTxFee.GetFee(546))); + QString toolTip3 = tr("This label turns red if any recipient receives an amount smaller than the current dust threshold."); // how many satoshis the estimated fee can vary per byte we guess wrong double dFeeVary; diff --git a/src/qt/coincontroldialog.h b/src/qt/coincontroldialog.h index 8ff1eac709300..1a467eb2ffba2 100644 --- a/src/qt/coincontroldialog.h +++ b/src/qt/coincontroldialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/coincontroltreewidget.cpp b/src/qt/coincontroltreewidget.cpp index 5dcbf0c3f17e3..f86bc0851f24e 100644 --- a/src/qt/coincontroltreewidget.cpp +++ b/src/qt/coincontroltreewidget.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h index d59fce2d41c13..ddb67ece72302 100644 --- a/src/qt/editaddressdialog.h +++ b/src/qt/editaddressdialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 216f23f1396bb..5ceffcd70af58 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index 6dce9370d75d2..ff4320b36a480 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -62,6 +62,10 @@ #include #endif +#if QT_VERSION >= 0x50200 +#include +#endif + #if BOOST_FILESYSTEM_VERSION >= 3 static boost::filesystem::detail::utf8_codecvt_facet utf8; #endif @@ -90,6 +94,9 @@ QString dateTimeStr(qint64 nTime) QFont fixedPitchFont() { +#if QT_VERSION >= 0x50200 + return QFontDatabase::systemFont(QFontDatabase::FixedFont); +#else QFont font("Monospace"); #if QT_VERSION >= 0x040800 font.setStyleHint(QFont::Monospace); @@ -97,6 +104,7 @@ QFont fixedPitchFont() font.setStyleHint(QFont::TypeWriter); #endif return font; +#endif } void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent) @@ -217,7 +225,7 @@ QString formatBitcoinURI(const SendCoinsRecipient &info) if (!info.message.isEmpty()) { - QString msg(QUrl::toPercentEncoding(info.message));; + QString msg(QUrl::toPercentEncoding(info.message)); ret += QString("%1message=%2").arg(paramCount == 0 ? "?" : "&").arg(msg); paramCount++; } @@ -898,6 +906,9 @@ QString formatServicesStr(quint64 mask) case NODE_GETUTXO: strList.append("GETUTXO"); break; + case NODE_BLOOM: + strList.append("BLOOM"); + break; default: strList.append(QString("%1[%2]").arg("UNKNOWN").arg(check)); } diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index ec678c4af2277..9267e0a6c9db0 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index ab63e98d40970..e0b84ba13fb07 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/intro.h b/src/qt/intro.h index 1d49922e93ca4..9e2e96dc9eca7 100644 --- a/src/qt/intro.h +++ b/src/qt/intro.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/locale/bitcoin_af_ZA.ts b/src/qt/locale/bitcoin_af_ZA.ts index d55d2f58acf80..d77aa77f8e6f8 100644 --- a/src/qt/locale/bitcoin_af_ZA.ts +++ b/src/qt/locale/bitcoin_af_ZA.ts @@ -214,6 +214,14 @@ EditAddressDialog + + &Label + &Etiket + + + &Address + &Adres + New receiving address Nuwe ontvangende adres @@ -261,6 +269,10 @@ Options Opsies + + W&allet + &Beursie + OverviewPage @@ -294,6 +306,14 @@ ReceiveCoinsDialog + + &Amount: + &Bedrag: + + + &Message: + &Boodskap: + Copy amount Kopieer bedrag @@ -347,10 +367,18 @@ Send Coins Stuur Munstukke + + Insufficient funds! + Onvoldoende fondse + Amount: Bedrag: + + Transaction Fee: + Transaksie fooi: + Send to multiple recipients at once Stuur aan vele ontvangers op eens @@ -374,6 +402,10 @@ SendCoinsEntry + + A&mount: + &Bedrag: + Message: Boodskap: @@ -453,6 +485,10 @@ Transaction ID Transaksie ID + + Transaction + Transaksie + Amount Bedrag diff --git a/src/qt/locale/bitcoin_ar.ts b/src/qt/locale/bitcoin_ar.ts index 8a54f157912d6..88ce05bbd5dbc 100644 --- a/src/qt/locale/bitcoin_ar.ts +++ b/src/qt/locale/bitcoin_ar.ts @@ -93,7 +93,11 @@ Exporting Failed فشل التصدير - + + There was an error trying to save the address list to %1. Please try again. + لقد حدث خطأ أثناء حفظ قائمة العناوين إلى %1. يرجى المحاولة مرة أخرى. + + AddressTableModel @@ -333,6 +337,10 @@ Wallet محفظة + + &Send + &ارسل + &Receive &استقبل @@ -377,6 +385,10 @@ &About Bitcoin Core حول bitcoin core + + %1 and %2 + %1 و %2 + Error خطأ @@ -779,6 +791,10 @@ PaymentServer + + Bad response from server %1 + استجابة سيئة من الملقم %1 + PeerTableModel @@ -789,6 +805,14 @@ Amount المبلغ + + %1 h + %1 ساعة + + + %1 m + %1 دقيقة + N/A غير معروف @@ -831,6 +855,10 @@ &Information المعلومات + + Debug window + نافذة المعالجة + General عام @@ -907,6 +935,22 @@ Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. استخدم اسهم الاعلى و الاسفل للتنقل بين السجلات و <b>Ctrl-L</b> لمسح الشاشة + + %1 B + %1 بايت + + + %1 KB + %1 كيلو بايت + + + %1 MB + %1 ميقا بايت + + + %1 GB + %1 قيقا بايت + Yes نعم @@ -1075,6 +1119,10 @@ Change: تعديل : + + Transaction Fee: + رسوم المعاملة: + Send to multiple recipients at once إرسال إلى عدة مستلمين في وقت واحد @@ -1107,6 +1155,10 @@ Confirm send coins تأكيد الإرسال Coins + + %1 to %2 + %1 الى %2 + Copy quantity نسخ الكمية @@ -1143,6 +1195,10 @@ The amount exceeds your balance. القيمة تتجاوز رصيدك + + The total exceeds your balance when the %1 transaction fee is included. + المجموع يتجاوز رصيدك عندما يتم اضافة %1 رسوم العملية + (no label) (لا وصف) @@ -1150,6 +1206,10 @@ SendCoinsEntry + + A&mount: + &القيمة + Pay &To: ادفع &الى : @@ -1178,6 +1238,10 @@ Message: الرسائل + + Pay To: + ادفع &الى : + ShutdownWindow @@ -1297,10 +1361,22 @@ TransactionDesc + + Open until %1 + مفتوح حتى %1 + conflicted يتعارض + + %1/offline + %1 غير متواجد + + + %1/unconfirmed + غير مؤكدة/%1 + %1 confirmations تأكيد %1 @@ -1411,6 +1487,10 @@ Type النوع + + Open until %1 + مفتوح حتى %1 + This block was not received by any other nodes and will probably not be accepted! لم يتم تلقى هذه الكتلة (Block) من قبل أي العقد الأخرى وربما لن تكون مقبولة! @@ -1427,6 +1507,10 @@ Label وصف + + Conflicted + يتعارض + Received with استقبل مع diff --git a/src/qt/locale/bitcoin_be_BY.ts b/src/qt/locale/bitcoin_be_BY.ts index 3343781b76e43..2709ff37e5157 100644 --- a/src/qt/locale/bitcoin_be_BY.ts +++ b/src/qt/locale/bitcoin_be_BY.ts @@ -798,7 +798,7 @@ command-line options опцыі каманднага радка - + Intro @@ -843,6 +843,10 @@ MB Мб + + W&allet + Гаманец + OverviewPage @@ -869,9 +873,21 @@ RPCConsole + + &Information + Інфармацыя + + + Debug window + Вакно адладкі + ReceiveCoinsDialog + + &Amount: + &Колькасць: + &Label: Метка: @@ -887,6 +903,10 @@ ReceiveRequestDialog + + Copy &Address + Капіяваць адрас + Address Адрас @@ -933,6 +953,10 @@ Send Coins Даслаць Манеты + + Insufficient funds! + Недастаткова сродкаў + Quantity: Колькасць: @@ -1044,6 +1068,14 @@ Alt+P Alt+P + + Message: + Паведамленне: + + + Pay To: + Заплаціць да: + Memo: Памятка: diff --git a/src/qt/locale/bitcoin_bg.ts b/src/qt/locale/bitcoin_bg.ts index be5aec371b3f2..ecd10e5461716 100644 --- a/src/qt/locale/bitcoin_bg.ts +++ b/src/qt/locale/bitcoin_bg.ts @@ -445,6 +445,36 @@ Catching up... Зарежда блокове... + + Date: %1 + + Дата: %1 + + + + Amount: %1 + + Сума: %1 + + + + Type: %1 + + Тип: %1 + + + + Label: %1 + + Етикет: %1 + + + + Address: %1 + + Адрес: %1 + + Sent transaction Изходяща транзакция @@ -776,7 +806,7 @@ command-line options Списък с налични команди - + Intro @@ -833,6 +863,10 @@ MB Мегабайта + + Number of script &verification threads + Брой на скриптове и &нишки за потвърждение + Accept connections from outside Приемай връзки отвън @@ -873,6 +907,10 @@ Expert Експерт + + Enable coin &control features + Позволяване на монетите и &техните възможности + &Spend unconfirmed change &Похарчете непотвърденото ресто @@ -2234,6 +2272,10 @@ Export Transaction History Изнасяне историята на транзакциите + + Watch-only + само гледане + Exporting Failed Грешка при изнасянето @@ -2417,6 +2459,10 @@ Information Информация + + Invalid amount for -maxtxfee=<amount>: '%s' + Невалидна сума за -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Невалидна сума за -minrelaytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_bg_BG.ts b/src/qt/locale/bitcoin_bg_BG.ts index d1157a8e4440f..353f6d7715ec9 100644 --- a/src/qt/locale/bitcoin_bg_BG.ts +++ b/src/qt/locale/bitcoin_bg_BG.ts @@ -60,6 +60,10 @@ Bitcoin Core Биткойн ядро + + About Bitcoin Core + За Биткойн ядрото + Intro diff --git a/src/qt/locale/bitcoin_ca.ts b/src/qt/locale/bitcoin_ca.ts index 5a0e36de9eb6d..38e770f182242 100644 --- a/src/qt/locale/bitcoin_ca.ts +++ b/src/qt/locale/bitcoin_ca.ts @@ -222,7 +222,15 @@ BanTableModel - + + IP/Netmask + IP / Màscara de xarxa + + + Banned Until + Bandejat fins + + BitcoinGUI @@ -874,6 +882,34 @@ command-line options Opcions de la línia d'ordres + + UI Options: + Opcions d'interfície d'usuari: + + + Choose data directory on startup (default: %u) + Trieu el directori de dades a l'inici (per defecte: %u) + + + Set language, for example "de_DE" (default: system locale) + Defineix la llengua, per exemple «de_DE» (per defecte: la definida pel sistema) + + + Start minimized + Inicia minimitzat + + + Set SSL root certificates for payment request (default: -system-) + Defineix els certificats arrel SSL per a la sol·licitud de pagament (per defecte: els del sistema) + + + Show splash screen on startup (default: %u) + Mostra la pantalla de benvinguda a l'inici (per defecte: %u) + + + Reset all settings changes made over the GUI + Reinicialitza tots els canvis de configuració fets des de la interfície gràfica + Intro @@ -1071,6 +1107,18 @@ Port of the proxy (e.g. 9050) Port del proxy (per exemple 9050) + + Used for reaching peers via: + Utilitzat per arribar als iguals mitjançant: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Mostra si el proxy SOCKS5 per defecte proporcionat s'utilitza per arribar als iguals mitjançant aquest tipus de xarxa. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor: + &Window &Finestra @@ -1457,10 +1505,18 @@ &Peers &Iguals + + Banned peers + Iguals bandejats + Select a peer to view detailed information. Seleccioneu un igual per mostrar informació detallada. + + Whitelisted + A la llista blanca + Direction Direcció @@ -1469,6 +1525,18 @@ Version Versió + + Starting Block + Bloc d'inici + + + Synced Headers + Capçaleres sincronitzades + + + Synced Blocks + Blocs sincronitzats + User Agent Agent d'usuari @@ -1497,6 +1565,14 @@ Ping Time Temps de ping + + The duration of a currently outstanding ping. + La duració d'un ping més destacat actualment. + + + Ping Wait + Espera de ping + Time Offset Diferència horària @@ -1545,6 +1621,34 @@ Clear console Neteja la consola + + &Disconnect Node + &Desconnecta el node + + + Ban Node for + Bandeja el node durant + + + 1 &hour + 1 &hora + + + 1 &day + 1 &dia + + + 1 &week + 1 &setmana + + + 1 &year + 1 &any + + + &Unban Node + &Desbandeja el node + Welcome to the Bitcoin Core RPC console. Us donem la benviguda a la consola RPC del Bitcoin Core. @@ -1573,6 +1677,10 @@ %1 GB %1 GB + + (node id: %1) + (id del node: %1) + via %1 a través de %1 @@ -1965,6 +2073,10 @@ Copy change Copia el canvi + + Total Amount %1 + Import total %1 + or o @@ -1997,6 +2109,10 @@ Payment request expired. La sol·licitud de pagament ha vençut. + + Pay only the required fee of %1 + Paga només la comissió necessària de %1 + Estimated to begin confirmation within %n block(s). Estimat per començar la confirmació en %n bloc.Estimat per començar la confirmació en %n blocs. @@ -2779,6 +2895,14 @@ Accept command line and JSON-RPC commands Accepta la línia d'ordres i ordres JSON-RPC + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Comissions totals màximes (en %s) per utilitzar en una única transacció de moneder; definir-ne una massa baixa pot interrompre les transaccions més grans (per defecte: %s) + + + Fee (in %s/kB) to add to transactions you send (default: %s) + Comissió (en %s/kB) per afegir a les transaccions que envieu (per defecte: %s) + Run in the background as a daemon and accept commands Executa en segon pla com a programa dimoni i accepta ordres diff --git a/src/qt/locale/bitcoin_ca@valencia.ts b/src/qt/locale/bitcoin_ca@valencia.ts index 353e80ca18608..2c41ec78d4061 100644 --- a/src/qt/locale/bitcoin_ca@valencia.ts +++ b/src/qt/locale/bitcoin_ca@valencia.ts @@ -433,6 +433,10 @@ No block source available... No hi ha cap font de bloc disponible... + + Processed %n block(s) of transaction history. + Proccessats %n bloc de l'historial de transaccions.Proccessats %n blocs de l'historial de transaccions. + %n hour(s) %n hora%n hores @@ -870,7 +874,7 @@ command-line options Opcions de la línia d'ordes - + Intro @@ -1067,6 +1071,10 @@ Port of the proxy (e.g. 9050) Port del proxy (per exemple 9050) + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor: + &Window &Finestra diff --git a/src/qt/locale/bitcoin_ca_ES.ts b/src/qt/locale/bitcoin_ca_ES.ts index bf4be89a03d90..e6a932ebeeaed 100644 --- a/src/qt/locale/bitcoin_ca_ES.ts +++ b/src/qt/locale/bitcoin_ca_ES.ts @@ -222,7 +222,15 @@ BanTableModel - + + IP/Netmask + IP / Màscara de xarxa + + + Banned Until + Bandejat fins + + BitcoinGUI @@ -874,6 +882,34 @@ command-line options Opcions de la línia d'ordres + + UI Options: + Opcions d'interfície d'usuari: + + + Choose data directory on startup (default: %u) + Trieu el directori de dades a l'inici (per defecte: %u) + + + Set language, for example "de_DE" (default: system locale) + Defineix la llengua, per exemple «de_DE» (per defecte: la definida pel sistema) + + + Start minimized + Inicia minimitzat + + + Set SSL root certificates for payment request (default: -system-) + Defineix els certificats arrel SSL per a la sol·licitud de pagament (per defecte: els del sistema) + + + Show splash screen on startup (default: %u) + Mostra la pantalla de benvinguda a l'inici (per defecte: %u) + + + Reset all settings changes made over the GUI + Reinicialitza tots els canvis de configuració fets des de la interfície gràfica + Intro @@ -1071,6 +1107,18 @@ Port of the proxy (e.g. 9050) Port del proxy (per exemple 9050) + + Used for reaching peers via: + Utilitzat per arribar als iguals mitjançant: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Mostra si el proxy SOCKS5 per defecte proporcionat s'utilitza per arribar als iguals mitjançant aquest tipus de xarxa. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor: + &Window &Finestra @@ -1457,10 +1505,18 @@ &Peers &Iguals + + Banned peers + Iguals bandejats + Select a peer to view detailed information. Seleccioneu un igual per mostrar informació detallada. + + Whitelisted + A la llista blanca + Direction Direcció @@ -1469,6 +1525,18 @@ Version Versió + + Starting Block + Bloc d'inici + + + Synced Headers + Capçaleres sincronitzades + + + Synced Blocks + Blocs sincronitzats + User Agent Agent d'usuari @@ -1497,6 +1565,14 @@ Ping Time Temps de ping + + The duration of a currently outstanding ping. + La duració d'un ping més destacat actualment. + + + Ping Wait + Espera de ping + Time Offset Diferència horària @@ -1545,6 +1621,34 @@ Clear console Neteja la consola + + &Disconnect Node + &Desconnecta el node + + + Ban Node for + Bandeja el node durant + + + 1 &hour + 1 &hora + + + 1 &day + 1 &dia + + + 1 &week + 1 &setmana + + + 1 &year + 1 &any + + + &Unban Node + &Desbandeja el node + Welcome to the Bitcoin Core RPC console. Us donem la benviguda a la consola RPC del Bitcoin Core. @@ -1573,6 +1677,10 @@ %1 GB %1 GB + + (node id: %1) + (id del node: %1) + via %1 a través de %1 @@ -1965,6 +2073,10 @@ Copy change Copia el canvi + + Total Amount %1 + Import total %1 + or o @@ -1997,6 +2109,10 @@ Payment request expired. La sol·licitud de pagament ha vençut. + + Pay only the required fee of %1 + Paga només la comissió necessària de %1 + Estimated to begin confirmation within %n block(s). Estimat per començar la confirmació en %n bloc.Estimat per començar la confirmació en %n blocs. @@ -2779,6 +2895,14 @@ Accept command line and JSON-RPC commands Accepta la línia d'ordres i ordres JSON-RPC + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Comissions totals màximes (en %s) per utilitzar en una única transacció de moneder; definir-ne una massa baixa pot interrompre les transaccions més grans (per defecte: %s) + + + Fee (in %s/kB) to add to transactions you send (default: %s) + Comissió (en %s/kB) per afegir a les transaccions que envieu (per defecte: %s) + Run in the background as a daemon and accept commands Executa en segon pla com a programa dimoni i accepta ordres diff --git a/src/qt/locale/bitcoin_cs.ts b/src/qt/locale/bitcoin_cs.ts index d791d9d98df6b..ef1903edd168e 100644 --- a/src/qt/locale/bitcoin_cs.ts +++ b/src/qt/locale/bitcoin_cs.ts @@ -874,7 +874,7 @@ command-line options možnosti příkazové řádky - + Intro @@ -1071,6 +1071,10 @@ Port of the proxy (e.g. 9050) Port proxy (např. 9050) + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Použít samostatnou SOCKS5 proxy ke spojení s protějšky přes skryté služby v Toru: + &Window O&kno @@ -3323,6 +3327,10 @@ Specify connection timeout in milliseconds (minimum: 1, default: %d) Zadej časový limit spojení v milivteřinách (minimum: 1, výchozí: %d) + + Specify pid file (default: %s) + PID soubor (výchozí: %s) + Spend unconfirmed change when sending transactions (default: %u) Utrácet i ještě nepotvrzené drobné při posílání transakcí (výchozí: %u) diff --git a/src/qt/locale/bitcoin_cs_CZ.ts b/src/qt/locale/bitcoin_cs_CZ.ts index 026247e7c6ef3..cc0c791154a90 100644 --- a/src/qt/locale/bitcoin_cs_CZ.ts +++ b/src/qt/locale/bitcoin_cs_CZ.ts @@ -191,6 +191,10 @@ CoinControlDialog + + Amount: + Množství: + Amount Množství @@ -322,6 +326,14 @@ ReceiveCoinsDialog + + &Label: + &Popisek: + + + &Message: + Zpráva: + Copy label Kopírovat popis @@ -341,6 +353,10 @@ Label Popis + + Message + Zpráva + RecentRequestsTableModel @@ -352,6 +368,10 @@ Label Popis + + Message + Zpráva + Amount Množství @@ -363,6 +383,10 @@ SendCoinsDialog + + Amount: + Množství: + Balance: Zůstatek: @@ -378,6 +402,10 @@ SendCoinsEntry + + &Label: + &Popisek: + Message: Zpráva: @@ -417,6 +445,14 @@ Date Datum + + Message + Zpráva + + + Transaction + Transakce + Amount Množství diff --git a/src/qt/locale/bitcoin_cy.ts b/src/qt/locale/bitcoin_cy.ts index eba03633342d5..c32d236a919e2 100644 --- a/src/qt/locale/bitcoin_cy.ts +++ b/src/qt/locale/bitcoin_cy.ts @@ -347,6 +347,10 @@ CoinControlDialog + + Amount: + Maint + Date Dyddiad @@ -545,6 +549,10 @@ ReceiveRequestDialog + + Copy &Address + &Cyfeiriad Copi + Address Cyfeiriad @@ -583,6 +591,10 @@ Send Coins Anfon arian + + Amount: + Maint + Send to multiple recipients at once Anfon at pobl lluosog ar yr un pryd @@ -626,6 +638,10 @@ Alt+P Alt+P + + Message: + Neges: + ShutdownWindow @@ -761,6 +777,10 @@ bitcoin-core + + Options: + Opsiynau: + Information Gwybodaeth diff --git a/src/qt/locale/bitcoin_da.ts b/src/qt/locale/bitcoin_da.ts index edcd9b3b0390d..aa2724a1e81ca 100644 --- a/src/qt/locale/bitcoin_da.ts +++ b/src/qt/locale/bitcoin_da.ts @@ -882,6 +882,34 @@ command-line options kommandolinjetilvalg + + UI Options: + Indstillinger for brugergrænseflade: + + + Choose data directory on startup (default: %u) + Vælg datamappe under opstart (standard: %u) + + + Set language, for example "de_DE" (default: system locale) + Vælg sprog; fx "da_DK" (standard: systemsprog) + + + Start minimized + Start minimeret + + + Set SSL root certificates for payment request (default: -system-) + Opsæt SSL-rodcertifikater til betalingsadmodninger (standard: -system-) + + + Show splash screen on startup (default: %u) + Vis startskærm under opstart (standard: %u) + + + Reset all settings changes made over the GUI + Nulstil alle indstillinger, der er foretaget i den grafiske brugerflade + Intro @@ -925,7 +953,11 @@ %n GB of free space available %n GB fri plads tilgængelig%n GB fri plads tilgængelig - + + (of %n GB needed) + (ud af %n GB behøvet)(ud af %n GB behøvet) + + OpenURIDialog @@ -1473,6 +1505,18 @@ Current number of blocks Nuværende antal blokke + + Memory Pool + Hukommelsespulje + + + Current number of transactions + Aktuelt antal transaktioner + + + Memory usage + Hukommelsesforbrug + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Åbn Bitcoin Cores fejlsøgningslogfil fra den aktuelle datamappe. Dette kan tage nogle få sekunder for store logfiler. @@ -3479,6 +3523,10 @@ Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Fejl under læsning af wallet.dat! Alle nøgler blev læst korrekt, men transaktionsdata eller indgange i adressebogen kan mangle eller være ukorrekte. + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Gebyrer (i %s/kB) mindre end dette opfattes som intet gebyr under oprettelse af transaktioner (standard: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Hvor gennemarbejdet blokverificeringen for -checkblocks er (0-4; standard: %u) @@ -3495,6 +3543,10 @@ Output debugging information (default: %u, supplying <category> is optional) Udskriv fejlsøgningsinformation (standard: %u, angivelse af <kategori> er valgfri) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Understøt filtrering af blokke og transaktioner med Bloom-filtre (standard: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. Den totale længde på netværksversionsstrengen (%i) overstiger maksimallængden (%i). Reducér antaller af eller størrelsen på uacomments. @@ -3511,6 +3563,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Brug separat SOCS5-proxy for at nå knuder via skjulte Tor-tjenester (standard: %s) + + 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. This option can be specified multiple times + Brugernavn og hashet adgangskode for JSON-RPC-forbindelser. Feltet <userpw> er i formatet: <BRUGERNAVN>:<SALT>$<HASH>. Et kanonisk Python-skript inkluderes i share/rpcuser. Dette tilvalg kan angives flere gange + (default: %s) (standard: %s) diff --git a/src/qt/locale/bitcoin_de.ts b/src/qt/locale/bitcoin_de.ts index 04b4d230107f6..84de80aff50d3 100644 --- a/src/qt/locale/bitcoin_de.ts +++ b/src/qt/locale/bitcoin_de.ts @@ -882,6 +882,34 @@ command-line options Kommandozeilenoptionen + + UI Options: + UI Einstellungen: + + + Choose data directory on startup (default: %u) + Datenverzeichnis beim Starten auswählen (Standard: %u) + + + Set language, for example "de_DE" (default: system locale) + Sprache einstellen, zum Beispiel "de_DE" (default: system locale) + + + Start minimized + Minimiert starten + + + Set SSL root certificates for payment request (default: -system-) + SSL-Wurzelzertifikate für Zahlungsanforderungen festlegen (Standard: -system-) + + + Show splash screen on startup (default: %u) + Startbildschirm beim Starten anzeigen (Standard: %u) + + + Reset all settings changes made over the GUI + Setze alle Einstellungen zurück, die über die grafische Oberfläche geändert wurden. + Intro @@ -1079,6 +1107,14 @@ Port of the proxy (e.g. 9050) Port des Proxies (z.B. 9050) + + Used for reaching peers via: + Benutzt um Gegenstellen zu erreichen über: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Zeigt an, ob der eingegebene Standard SOCKS5 Proxy genutzt wird um Peers mit dem Netzwerktyp zu erreichen. + IPv4 IPv4 @@ -1091,6 +1127,10 @@ Tor Tor + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + Über einen separaten SOCKS5 Proxy für Tor Services mit dem Bitcoint Netzwerk verbinden. + Use separate SOCKS5 proxy to reach peers via Tor hidden services: Separaten SOCKS5-Proxy verwenden, um Gegenstellen über versteckte Tor-Dienste zu erreichen: @@ -1465,6 +1505,18 @@ Current number of blocks Aktuelle Anzahl Blöcke + + Memory Pool + Speicherpool + + + Current number of transactions + Aktuelle Anzahl der Transaktionen + + + Memory usage + Speichernutzung + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Öffnet die "Bitcoin Core"-Debugprotokolldatei aus dem aktuellen Datenverzeichnis. Dies kann bei großen Protokolldateien einige Sekunden dauern. @@ -1489,6 +1541,10 @@ Select a peer to view detailed information. Gegenstelle auswählen, um detaillierte Informationen zu erhalten. + + Whitelisted + Zugelassene + Direction Richtung @@ -1497,6 +1553,10 @@ Version Version + + Starting Block + Start Block + Synced Headers Synchronisierte Kopfdaten @@ -1533,6 +1593,14 @@ Ping Time Pingzeit + + The duration of a currently outstanding ping. + Die Laufzeit eines aktuell ausstehenden Ping. + + + Ping Wait + Ping Wartezeit + Time Offset Zeitversatz @@ -1585,6 +1653,10 @@ &Disconnect Node Knoten &trennen + + Ban Node for + Knoten gebannt für + 1 &hour 1 &Stunde @@ -1601,6 +1673,10 @@ 1 &year 1 &Jahr + + &Unban Node + &Node entsperren + Welcome to the Bitcoin Core RPC console. Willkommen in der "Bitcoin Core"-RPC-Konsole. @@ -2700,6 +2776,10 @@ Copy transaction ID Transaktions-ID kopieren + + Copy raw transaction + Kopiere rohe Transaktion + Edit label Bezeichnung bearbeiten @@ -2847,6 +2927,14 @@ Accept command line and JSON-RPC commands Kommandozeilen- und JSON-RPC-Befehle annehmen + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Maximale Gesamtgebühr (in %s) in einer Börsentransaktion; wird dies zu niedrig gesetzten können große Transaktionen abgebrochen werden (Standard: %s) + + + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Bitte korrigieren Sie die Datums- und Uhrzeiteinstellungen Ihres Computers, da Bitcoin Core ansonsten nicht ordnungsgemäß funktionieren wird. + Error: A fatal internal error occurred, see debug.log for details Fehler: Ein schwerer interner Fehler ist aufgetreten, siehe debug.log für Details. @@ -2859,6 +2947,10 @@ Run in the background as a daemon and accept commands Als Hintergrunddienst ausführen und Befehle annehmen + + Unable to start HTTP server. See debug log for details. + Kann HTTP Server nicht starten. Siehe debug log für Details. + Accept connections from outside (default: 1 if no -proxy or -connect) Eingehende Verbindungen annehmen (Standard: 1, wenn nicht -proxy oder -connect) @@ -2951,6 +3043,18 @@ Do you want to rebuild the block database now? Möchten Sie die Blockdatenbank jetzt neu aufbauen? + + Enable publish hash block in <address> + Aktiviere das Veröffentlichen des Hash-Blocks in <address> + + + Enable publish hash transaction in <address> + Aktiviere das Veröffentlichen der Hash-Transaktion in <address> + + + Enable publish raw block in <address> + Aktiviere das Veröffentlichen des Raw-Blocks in <address> + Error initializing block database Fehler beim Initialisieren der Blockdatenbank @@ -3147,6 +3251,10 @@ Attempt to recover private keys from a corrupt wallet.dat on startup Versuchen, private Schlüssel beim Starten aus einer beschädigten wallet.dat wiederherzustellen + + Automatically create Tor hidden service (default: %d) + Automatisch versteckten Tor-Dienst erstellen (Standard: %d) + Cannot resolve -whitebind address: '%s' Kann Adresse in -whitebind nicht auflösen: '%s' @@ -3255,6 +3363,14 @@ This is experimental software. Dies ist experimentelle Software. + + Tor control port password (default: empty) + TOR Kontrollport Passwort (Standard: leer) + + + Tor control port to use if onion listening enabled (default: %s) + Zu benutzender TOR Kontrollport wenn Onion Auflistung aktiv ist (Standard: %s) + Transaction amount too small Transaktionsbetrag zu niedrig @@ -3291,6 +3407,10 @@ Warning Warnung + + Whether to operate in a blocks only mode (default: %u) + Legt fest ob nur Blöcke Modus aktiv sein soll (Standard: %u) + Zapping all transactions from wallet... Lösche alle Transaktionen aus Wallet... @@ -3339,6 +3459,10 @@ -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. -paytxfee ist auf einen sehr hohen Wert festgelegt! Dies ist die Gebühr die beim Senden einer Transaktion fällig wird. + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Die Transaktion nicht länger im Speicherpool behalten als <n> Stunden (Standard: %u) + Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Lesen von wallet.dat fehlgeschlagen! Alle Schlüssel wurden korrekt gelesen, Transaktionsdaten bzw. Adressbucheinträge fehlen aber möglicherweise oder sind inkorrekt. @@ -3359,6 +3483,10 @@ Output debugging information (default: %u, supplying <category> is optional) Debugginginformationen ausgeben (Standard: %u, <category> anzugeben ist optional) + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + Versucht ausgehenden Datenverkehr unter dem gegebenen Wert zu halten (in MiB pro 24h), 0 = kein Limit (default: %d) + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Nicht unterstütztes Argument -socks gefunden. Das Festlegen der SOCKS-Version ist nicht mehr möglich, nur noch SOCKS5-Proxies werden unterstützt. @@ -3399,6 +3527,10 @@ Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) <port> nach JSON-RPC-Verbindungen abhören (Standard: %u oder Testnetz: %u) + + Listen for connections on <port> (default: %u or testnet: %u) + <port> nach Verbindungen abhören (Standard: %u oder Testnetz: %u) + Maintain at most <n> connections to peers (default: %u) Maximal <n> Verbindungen zu Gegenstellen aufrechterhalten (Standard: %u) diff --git a/src/qt/locale/bitcoin_el.ts b/src/qt/locale/bitcoin_el.ts index f53a88082d56d..6777961cbc309 100644 --- a/src/qt/locale/bitcoin_el.ts +++ b/src/qt/locale/bitcoin_el.ts @@ -82,6 +82,14 @@ EditAddressDialog + + &Label + Ετικέτα + + + &Address + Διεύθυνση + FreespaceChecker @@ -109,6 +117,10 @@ OptionsDialog + + W&allet + Πορτοφόλι + OverviewPage @@ -183,6 +195,10 @@ SendCoinsDialog + + Insufficient funds! + Κεφάλαια μη επαρκή + Recommended: Συνίσταται: @@ -202,6 +218,10 @@ SendCoinsEntry + + Message: + Μήνυμα: + ShutdownWindow diff --git a/src/qt/locale/bitcoin_el_GR.ts b/src/qt/locale/bitcoin_el_GR.ts index b62a4756e11cf..90c27c43943ac 100644 --- a/src/qt/locale/bitcoin_el_GR.ts +++ b/src/qt/locale/bitcoin_el_GR.ts @@ -694,6 +694,10 @@ This label turns red if any recipient receives an amount smaller than %1. Αυτή η ετικέτα γίνεται κόκκινη αν οποιοσδήποτε παραλήπτης λάβει ποσό μικρότερο από %1. + + Can vary +/- %1 satoshi(s) per input. + Μπορεί να διαφέρει +/- %1 Satoshi (ες) ανά εγγραφή. + yes ναι @@ -706,6 +710,10 @@ This means a fee of at least %1 per kB is required. Ελάχιστο χρεώσιμο ποσό τουλάχιστο %1 ανα kB + + Can vary +/- 1 byte per input. + Μπορεί να διαφέρει +/- 1 byte ανά εγγραφή. + Transactions with higher priority are more likely to get included into a block. Συναλλαγές με υψηλότερη προτεραιότητα είναι πιο πιθανό να περιλαμβάνονται σε ένα μπλοκ. @@ -832,7 +840,7 @@ command-line options επιλογής γραμμής εντολών - + Intro @@ -2602,6 +2610,10 @@ Only connect to nodes in network <net> (ipv4, ipv6 or onion) Μόνο σύνδεση σε κόμβους του δικτύου <net> (ipv4, ipv6 ή onion) + + Set maximum block size in bytes (default: %d) + Ορίστε το μέγιστο μέγεθος block σε bytes (προεπιλογή: %d) + Specify wallet file (within data directory) Επιλέξτε αρχείο πορτοφολιού (μέσα απο κατάλογο δεδομένων) @@ -2630,6 +2642,10 @@ Connect through SOCKS5 proxy Σύνδεση μέσω διαμεσολαβητή SOCKS5 + + Copyright (C) 2009-%i The Bitcoin Core Developers + Πνευματικά δικαιώματα 2009-%i Οι προγραμματιστές του Bitcoin Core + Error loading wallet.dat: Wallet requires newer version of Bitcoin Core Σφάλμα φόρτωσης wallet.dat: Το Πορτοφόλι απαιτεί μια νεότερη έκδοση του Bitcoin @@ -2646,6 +2662,10 @@ Initialization sanity check failed. Bitcoin Core is shutting down. Η εκκίνηση ελέγχου ορθότητας απέτυχε. Γίνεται τερματισμός του Bitcoin Core. + + Invalid amount for -maxtxfee=<amount>: '%s' + Μη έγκυρο ποσό για την παράμετρο -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Μη έγκυρο ποσό για την παράμετρο -paytxfee=<amount>: '%s' @@ -2766,6 +2786,14 @@ Invalid -proxy address: '%s' Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή: '%s' + + Maintain at most <n> connections to peers (default: %u) + Μέγιστες αριθμός συνδέσεων με τους peers <n> (προεπιλογή: %u) + + + Specify configuration file (default: %s) + Ορίστε αρχείο ρυθμίσεων (προεπιλογή: %s) + Specify connection timeout in milliseconds (minimum: 1, default: %d) Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή: %d) diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index e709f8515bfcc..00411741f1b9a 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -1153,7 +1153,7 @@ - Reset all settings changes made over the GUI + Reset all settings changed in the GUI diff --git a/src/qt/locale/bitcoin_en_GB.ts b/src/qt/locale/bitcoin_en_GB.ts index 96cdecfe838a8..bf912d295e96f 100644 --- a/src/qt/locale/bitcoin_en_GB.ts +++ b/src/qt/locale/bitcoin_en_GB.ts @@ -882,6 +882,34 @@ command-line options command-line options + + UI Options: + UI Options: + + + Choose data directory on startup (default: %u) + Choose data directory on startup (default: %u) + + + Set language, for example "de_DE" (default: system locale) + Set language, for example "de_DE" (default: system locale) + + + Start minimized + Start minimised + + + Set SSL root certificates for payment request (default: -system-) + Set SSL root certificates for payment request (default: -system-) + + + Show splash screen on startup (default: %u) + Show splash screen on startup (default: %u) + + + Reset all settings changes made over the GUI + Reset all settings changes made over the GUI + Intro @@ -1477,6 +1505,18 @@ Current number of blocks Current number of blocks + + Memory Pool + Memory Pool + + + Current number of transactions + Current number of transactions + + + Memory usage + Memory usage + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. @@ -3483,6 +3523,10 @@ Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) How thorough the block verification of -checkblocks is (0-4, default: %u) @@ -3499,6 +3543,10 @@ Output debugging information (default: %u, supplying <category> is optional) Output debugging information (default: %u, supplying <category> is optional) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Support filtering of blocks and transaction with bloom filters (default: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. @@ -3515,6 +3563,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + + 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. This option can be specified multiple times + 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. This option can be specified multiple times + (default: %s) (default: %s) diff --git a/src/qt/locale/bitcoin_eo.ts b/src/qt/locale/bitcoin_eo.ts index c17e477654977..ab8dd65f81673 100644 --- a/src/qt/locale/bitcoin_eo.ts +++ b/src/qt/locale/bitcoin_eo.ts @@ -409,10 +409,22 @@ No block source available... Neniu fonto de blokoj trovebla... + + %n day(s) + %n tago%n tagoj + + + %n week(s) + %n semajno%n semajnoj + %1 and %2 %1 kaj %2 + + %n year(s) + %n jaro%n jaroj + %1 behind mankas %1 @@ -445,6 +457,30 @@ Catching up... Ĝisdatigante... + + Date: %1 + + Dato: %1 + + + + Amount: %1 + + Sumo: %1 + + + + Type: %1 + + Tipo: %1 + + + + Label: %1 + + Etikedo: %1 + + Sent transaction Sendita transakcio @@ -776,7 +812,7 @@ command-line options komandliniaj agordaĵoj - + Intro @@ -853,6 +889,14 @@ MB MB + + Accept connections from outside + Akcepti konektojn el ekstere + + + Allow incoming connections + Permesi envenantajn konektojn + Reset all client options to default. Reagordi ĉion al defaŭlataj valoroj. @@ -865,6 +909,10 @@ &Network &Reto + + W&allet + Monujo + Expert Fakulo @@ -889,6 +937,14 @@ Port of the proxy (e.g. 9050) la pordo de la prokurilo (ekz. 9050) + + IPv4 + IPv4 + + + IPv6 + IPv6 + &Window &Fenestro @@ -976,6 +1032,10 @@ Mined balance that has not yet matured Minita saldo, kiu ankoraŭ ne maturiĝis + + Balances + Saldoj + Total: Totalo: @@ -984,6 +1044,14 @@ Your current total balance via aktuala totala saldo + + Spendable: + Elspezebla: + + + Recent transactions + Lastaj transakcioj + PaymentServer @@ -1045,6 +1113,10 @@ %1 m %1 m + + None + Neniu + N/A neaplikebla @@ -1123,6 +1195,22 @@ Current number of blocks Aktuala nombro de blokoj + + Received + Ricevita + + + Sent + Sendita + + + Version + Versio + + + Services + Servoj + Last block time Horo de la lasta bloko @@ -1375,6 +1463,10 @@ Change: Restmono: + + Transaction Fee: + Krompago: + Send to multiple recipients at once Sendi samtempe al pluraj ricevantoj @@ -2209,10 +2301,18 @@ Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Plenumi komandon kiam rilata alerto riceviĝas, aŭ kiam ni vidas tre longan forkon (%s en cms anstataŭiĝas per mesaĝo) + + Cannot resolve -whitebind address: '%s' + Ne eblas trovi la adreson -whitebind: '%s' + Information Informoj + + Invalid amount for -maxtxfee=<amount>: '%s' + Nevalida sumo por -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Nevalida sumo por -minrelaytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_es.ts b/src/qt/locale/bitcoin_es.ts index bb7fcb10959ad..936074210a53d 100644 --- a/src/qt/locale/bitcoin_es.ts +++ b/src/qt/locale/bitcoin_es.ts @@ -23,7 +23,7 @@ C&lose - &Cerrar + C&errar &Copy Address @@ -55,7 +55,7 @@ C&hoose - &Escoger + E&scoger Sending addresses @@ -93,7 +93,11 @@ Exporting Failed Fallo al exportar - + + There was an error trying to save the address list to %1. Please try again. + Hubo un error al tratar de guardar en la lista de direcciones a %1 . Por favor, vuelve a intentarlo . + + AddressTableModel @@ -259,7 +263,7 @@ E&xit - &Salir + S&alir Quit application @@ -878,7 +882,23 @@ command-line options opciones de la consola de comandos - + + Choose data directory on startup (default: %u) + Elegir directorio de datos al iniciar (predeterminado: %u) + + + Set language, for example "de_DE" (default: system locale) + Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema) + + + Start minimized + Arrancar minimizado + + + Set SSL root certificates for payment request (default: -system-) + Establecer los certificados raíz SSL para solicitudes de pago (predeterminado: -system-) + + Intro @@ -1087,6 +1107,10 @@ Tor Tor + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima: + &Window &Ventana @@ -2021,6 +2045,10 @@ Copy change Copiar Cambio + + Total Amount %1 + Monto Total %1 + or o @@ -2045,6 +2073,10 @@ The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. ¡La transacción fue rechazada! Esto puede haber ocurrido si alguno de los bitcoins de su monedero ya estaba gastado o si ha usado una copia de wallet.dat y los bitcoins estaban gastados en la copia pero no se habían marcado como gastados aqui. + + A fee higher than %1 is considered an absurdly high fee. + Una comisión mayor al %1 se considera demasiado alta. + Payment request expired. Solicitud de pago caducada. @@ -2854,6 +2886,10 @@ Ejecutar en segundo plano como daemon y aceptar comandos + + Unable to start HTTP server. See debug log for details. + No se ha podido comenzar el servidor HTTP. Ver debug log para detalles. + Accept connections from outside (default: 1 if no -proxy or -connect) Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect) @@ -3074,6 +3110,10 @@ If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) 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) + + Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions) + Cantidad no válida para -maxtxfee=<amount>: '%s' (debe ser por lo menos la cuota de comisión mínima de %s para prevenir transacciones atascadas) + Maximum size of data in data carrier transactions we relay and mine (default: %u) El tamaño máximo de los datos en las operaciones de transporte de datos que transmitimos y el mio (default: %u) diff --git a/src/qt/locale/bitcoin_es_CL.ts b/src/qt/locale/bitcoin_es_CL.ts index c303007b7ac12..e6d48a29f07f9 100644 --- a/src/qt/locale/bitcoin_es_CL.ts +++ b/src/qt/locale/bitcoin_es_CL.ts @@ -301,6 +301,10 @@ Bitcoin Core bitcoin core + + %1 and %2 + %1 y %2 + Error Error @@ -351,6 +355,10 @@ Amount: Cantidad: + + Priority: + prioridad: + Amount Cantidad @@ -505,6 +513,10 @@ &Network &Red + + W&allet + Cartera + Expert experto @@ -636,6 +648,10 @@ &Information &Información + + Debug window + Ventana Debug + General General @@ -684,6 +700,10 @@ ReceiveCoinsDialog + + &Amount: + Cantidad: + &Label: &Etiqueta: @@ -761,10 +781,22 @@ Send Coins Enviar monedas + + Insufficient funds! + Fondos insuficientes + Amount: Cantidad: + + Priority: + prioridad: + + + Transaction Fee: + Comisión transacción: + Send to multiple recipients at once Enviar a múltiples destinatarios @@ -848,6 +880,10 @@ Message: Mensaje: + + Pay To: + Pagar a: + ShutdownWindow @@ -902,6 +938,10 @@ Click "Sign Message" to generate signature Click en "Firmar Mensage" para conseguir firma + + The entered address is invalid. + La dirección introducida no es una valida. + Please check the address and try again. Por favor, revise la dirección Bitcoin e inténtelo denuevo @@ -1308,6 +1348,18 @@ Information Información + + Invalid amount for -maxtxfee=<amount>: '%s' + Cantidad inválida para -maxtxfee=<amount>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + Cantidad inválida para -minrelaytxfee=<amount>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Cantidad inválida para -mintxfee=<amount>: '%s' + Send trace/debug info to console instead of debug.log file Enviar informacion de seguimiento a la consola en vez del archivo debug.log diff --git a/src/qt/locale/bitcoin_es_DO.ts b/src/qt/locale/bitcoin_es_DO.ts index 60347070dfab4..0463c0f6e1cdc 100644 --- a/src/qt/locale/bitcoin_es_DO.ts +++ b/src/qt/locale/bitcoin_es_DO.ts @@ -740,7 +740,7 @@ command-line options opciones de la línea de órdenes - + Intro @@ -829,6 +829,10 @@ &Network &Red + + W&allet + Monedero + Expert Experto @@ -1367,6 +1371,10 @@ Custom change address Dirección propia + + Transaction Fee: + Comisión de transacción: + Send to multiple recipients at once Enviar a múltiples destinatarios de una vez @@ -1518,6 +1526,10 @@ Remove this entry Eliminar esta transacción + + Message: + Mensaje: + Enter a label for this address to add it to the list of used addresses Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas @@ -2220,10 +2232,18 @@ Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Establecer tamaño máximo de las transacciones de alta prioridad/comisión baja en bytes (por defecto: %d) + + Cannot resolve -whitebind address: '%s' + No se puede resolver la dirección de -whitebind: '%s' + Information Información + + Invalid amount for -maxtxfee=<amount>: '%s' + Inválido por el monto -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Inválido por el monto -minrelaytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_es_ES.ts b/src/qt/locale/bitcoin_es_ES.ts index b19387d9ed9cd..bdbfed4ec634f 100644 --- a/src/qt/locale/bitcoin_es_ES.ts +++ b/src/qt/locale/bitcoin_es_ES.ts @@ -330,6 +330,14 @@ EditAddressDialog + + &Label + Etiqueta + + + &Address + Dirección + FreespaceChecker @@ -369,6 +377,10 @@ ReceiveRequestDialog + + Copy &Address + &Copiar Direccón + Address Dirección diff --git a/src/qt/locale/bitcoin_es_MX.ts b/src/qt/locale/bitcoin_es_MX.ts index e9a80e2f5f79b..fa2b3c0623be3 100644 --- a/src/qt/locale/bitcoin_es_MX.ts +++ b/src/qt/locale/bitcoin_es_MX.ts @@ -11,7 +11,7 @@ Copy the currently selected address to the system clipboard - Copiar el domicilio seleccionado al portapapeles del sistema + Copiar la dirección seleccionada al portapapeles del sistema &Copy @@ -83,7 +83,7 @@ Comma separated file (*.csv) - Arhchivo separado por comas (*.CSV) + Archivo separado por comas (*.CSV) Exporting Failed @@ -98,7 +98,7 @@ Address - Domicilio + Dirección (no label) @@ -165,7 +165,7 @@ Wallet encryption failed - Encriptación de la cartera fallida + La encriptación de la cartera fallo Wallet encryption failed due to an internal error. Your wallet was not encrypted. @@ -181,7 +181,7 @@ The passphrase entered for the wallet decryption was incorrect. - La contraseña ingresada para la desencriptación de la cartera es incorrecto + La contraseña ingresada para la desencriptación de la cartera es incorrecta Wallet decryption failed @@ -199,7 +199,7 @@ BitcoinGUI Sign &message... - Sign &mensaje + Firmar &mensaje Synchronizing with network... @@ -259,16 +259,20 @@ &Sending addresses... - &Enviando direcciones... + Direcciones de &envío... &Receiving addresses... - &Recibiendo direcciones... + Direcciones de &recepción... Open &URI... Abrir &URL... + + Bitcoin Core client + cliente Bitcoin Core + Importing blocks from disk... Importando bloques desde el disco... @@ -295,12 +299,28 @@ Open debugging and diagnostic console - Abrir la consola de depuración y disgnostico + Abrir consola de depuración y diagnostico &Verify message... &Verificar mensaje... + + Bitcoin + Bitcoin + + + Wallet + Cartera + + + &Send + &Enviar + + + &Receive + &Recibir + &File &Archivo @@ -321,6 +341,10 @@ Bitcoin Core nucleo Bitcoin + + &About Bitcoin Core + Acerca de Bitcoin Core + &Command-line options opciones de la &Linea de comandos @@ -335,7 +359,7 @@ Catching up... - Resiviendo... + Recibiendo... Sent transaction @@ -387,41 +411,45 @@ Confirmed Confirmado + + Priority + Prioridad + Copy address Copiar dirección Copy label - Copiar capa + Copiar etiqueta Copy amount - copiar monto + Copiar monto Copy quantity - copiar cantidad + Copiar cantidad Copy fee - copiar cuota + Copiar cuota Copy after fee - copiar despues de cuota + Copiar después de cuota Copy bytes - copiar bytes + Copiar bytes Copy priority - copiar prioridad + Copiar prioridad Copy change - copiar cambio + Copiar cambio (no label) @@ -444,23 +472,23 @@ New receiving address - Nueva dirección de entregas + Nueva dirección de recepción New sending address - Nueva dirección de entregas + Nueva dirección de envío Edit receiving address - Editar dirección de entregas + Editar dirección de recepción Edit sending address - Editar dirección de envios + Editar dirección de envío The entered address "%1" is already in the address book. - El domicilio ingresado "%1" ya existe en la libreta de direcciones + La dirección ingresada "%1" ya existe en la libreta de direcciones Could not unlock wallet. @@ -482,7 +510,7 @@ version - Versión + versión (%1-bit) @@ -492,6 +520,10 @@ About Bitcoin Core Acerca de Bitcoin Core + + Command-line options + opciones de la Linea de comandos + Usage: Uso: @@ -500,7 +532,7 @@ command-line options Opciones de comando de lineas - + Intro @@ -521,6 +553,10 @@ Active command-line options that override above options: Activar las opciones de linea de comando que sobre escriben las siguientes opciones: + + W&allet + Cartera + OverviewPage @@ -547,13 +583,25 @@ RPCConsole + + Debug window + Depurar ventana + ReceiveCoinsDialog + + &Amount: + Monto: + &Label: &Etiqueta + + &Message: + Mensaje: + 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. 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. @@ -568,18 +616,22 @@ Copy label - Copiar capa + Copiar etiqueta Copy amount - copiar monto + Copiar monto ReceiveRequestDialog + + Copy &Address + &Copiar dirección + Address - Domicilio + Dirección Amount @@ -589,6 +641,10 @@ Label Etiqueta + + Message + Mensaje + RecentRequestsTableModel @@ -600,6 +656,10 @@ Label Etiqueta + + Message + Mensaje + Amount Monto @@ -613,7 +673,7 @@ SendCoinsDialog Send Coins - Mandar monedas + Enviar monedas Bytes: @@ -631,6 +691,10 @@ Fee: Cuota: + + fast + rápido + Send to multiple recipients at once Enviar a múltiples receptores a la vez @@ -645,35 +709,35 @@ Confirm send coins - Confirme para mandar monedas + Confirme para enviar monedas Copy quantity - copiar cantidad + Copiar cantidad Copy amount - copiar monto + Copiar monto Copy fee - copiar cuota + Copiar cuota Copy after fee - copiar despues de cuota + Copiar después de cuota Copy bytes - copiar bytes + Copiar bytes Copy priority - copiar prioridad + Copiar prioridad Copy change - copiar cambio + Copiar cambio or @@ -685,7 +749,7 @@ Transaction creation failed! - ¡La creación de transacion falló! + ¡La creación de la transación falló! The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. @@ -776,12 +840,16 @@ Alt+P Alt+P + + Signature + Firma + SplashScreen Bitcoin Core - nucleo Bitcoin + Bitcoin Core The Bitcoin Core developers @@ -805,14 +873,42 @@ %1 confirmations %1 confirmaciones + + Status + Estado + Date Fecha + + From + De + + + To + Para + + + label + etiqueta + + + Message + Mensaje + + + Comment + Comentario + Transaction ID ID + + Transaction + Transacción + Amount Monto @@ -869,7 +965,7 @@ Received with - Recivido con + Recibido con Sent to @@ -928,7 +1024,7 @@ Received with - Recivido con + Recibido con Sent to @@ -986,6 +1082,10 @@ Exporting Successful Exportacion satisfactoria + + The transaction history was successfully saved to %1. + el historial de transaciones ha sido guardado exitosamente en %1 + Comma separated file (*.csv) Arhchivo separado por comas (*.CSV) @@ -1050,13 +1150,29 @@ There was an error trying to save the wallet data to %1. Ocurrio un error tratando de guardar la información de la cartera %1 + + The wallet data was successfully saved to %1. + La información de la cartera fué guardada exitosamente a %1 + bitcoin-core + + Options: + Opciones: + <category> can be: <categoria> puede ser: + + Verifying blocks... + Verificando bloques... + + + Verifying wallet... + Verificando cartera... + Wallet options: Opciones de cartera: diff --git a/src/qt/locale/bitcoin_es_UY.ts b/src/qt/locale/bitcoin_es_UY.ts index 5029333b5be4a..32d433d6ec3d6 100644 --- a/src/qt/locale/bitcoin_es_UY.ts +++ b/src/qt/locale/bitcoin_es_UY.ts @@ -1,22 +1,71 @@ AddressBookPage + + Right-click to edit address or label + Clic derecho para editar dirección o etiqueta + Create a new address Crear una nueva dirección + + &New + Nuevo + Copy the currently selected address to the system clipboard Copia la dirección seleccionada al portapapeles del sistema + + &Copy + Copiar + + + C&lose + Cerrar + + + &Copy Address + Copiar Dirección + + + &Export + Exportar + &Delete &Borrar + + Choose the address to send coins to + Elige una dirección donde enviar monedas a + + + Sending addresses + Enviando direcciones + + + Receiving addresses + Recibiendo direcciones + + + + &Edit + Editar + + + Export Address List + Exportar Lista de Direcciones + Comma separated file (*.csv) Archivos separados por coma (*.csv) + + Exporting Failed + Exportación fallida + AddressTableModel @@ -75,6 +124,14 @@ Confirm wallet encryption Confirme el cifrado del monedero + + Are you sure you wish to encrypt your wallet? + Estas seguro que deseas encriptar tu billetera? + + + Warning: The Caps Lock key is on! + Atención: la tecla Mayusculas esta activa! + Wallet encrypted Monedero cifrado @@ -129,18 +186,58 @@ Browse transaction history Buscar en el historial de transacciones + + E&xit + Salida + Quit application Salir de la aplicacion + + Show information about Qt + Mostrar informacioón sobre + &Options... &Opciones... + + &Backup Wallet... + Respaldar Billetera + + + &Change Passphrase... + Cambiar contraseña + + + &Sending addresses... + Enviando direcciones + + + &Receiving addresses... + Recibiendo direcciones + + + Send coins to a Bitcoin address + Enviar monedas a una dirección BItCoin + Change the passphrase used for wallet encryption Cambie la clave utilizada para el cifrado del monedero + + Bitcoin + Bitcoin + + + Wallet + Billetera + + + &Show / Hide + Mostrar / Ocultar + &File &Archivo @@ -157,6 +254,18 @@ Tabs toolbar Barra de herramientas + + Error + Error + + + Warning + Alerta + + + Information + Información + Up to date A la fecha @@ -165,6 +274,17 @@ Catching up... Ponerse al dia... + + Type: %1 + + Tipo: %1 + + + + Address: %1 + + Dirección: %1 + Sent transaction Transaccion enviada @@ -187,10 +307,38 @@ CoinControlDialog + + Quantity: + Cantidad: + + + Bytes: + Bytes: + + + Amount: + AMonto: + + + Priority: + Prioridad: + + + Change: + Cambio: + Date Fecha + + Confirmed + Confirmado + + + Priority + Prioridad + (no label) (Sin etiqueta) @@ -226,6 +374,10 @@ Edit sending address Editar dirección de envío + + The entered address "%1" is already in the address book. + La dirección introducida "%1" ya está en la libreta de direcciones. + Could not unlock wallet. No se puede abrir el monedero. @@ -243,6 +395,10 @@ Intro + + Error + Error + OpenURIDialog @@ -253,6 +409,10 @@ Options Opciones + + W&allet + Billetera + OverviewPage @@ -275,6 +435,10 @@ RPCConsole + + &Information + Información + ReceiveCoinsDialog @@ -285,6 +449,10 @@ ReceiveRequestDialog + + Copy &Address + Copiar Dirección + Address Direccion @@ -315,6 +483,26 @@ Send Coins Enviar monedas + + Quantity: + Cantidad: + + + Bytes: + Bytes: + + + Amount: + AMonto: + + + Priority: + Prioridad: + + + Change: + Cambio: + Send to multiple recipients at once Enviar a varios destinatarios a la vez @@ -370,6 +558,10 @@ Alt+P Alt+P + + Pay To: + Pagar A: + ShutdownWindow @@ -409,6 +601,10 @@ Date Fecha + + Transaction + Transaccion + unknown desconocido @@ -434,10 +630,18 @@ TransactionView + + Exporting Failed + Exportación fallida + Comma separated file (*.csv) Archivos separados por coma (*.csv) + + Confirmed + Confirmado + Date Fecha @@ -466,8 +670,28 @@ WalletView + + &Export + Exportar + bitcoin-core - + + Options: + Opciones: + + + Information + Información + + + Warning + Alerta + + + Error + Error + + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_es_VE.ts b/src/qt/locale/bitcoin_es_VE.ts index f9db0565535b1..582e72884607f 100644 --- a/src/qt/locale/bitcoin_es_VE.ts +++ b/src/qt/locale/bitcoin_es_VE.ts @@ -85,7 +85,11 @@ Exporting Failed Exportación fallida - + + There was an error trying to save the address list to %1. Please try again. + Hubo un error intentando guardar la lista de direcciones al %1. Por favor intente nuevamente. + + AddressTableModel @@ -233,6 +237,10 @@ Quit application Quitar aplicación + + &Receiving addresses... + Recepción de direcciones + Bitcoin Core client Cliente Bitcoin Core @@ -313,6 +321,14 @@ Bitcoin Core Bitcoin Core + + &About Bitcoin Core + Acerca de Bitcoin Core + + + &Command-line options + Opciones de línea de comandos + %1 and %2 %1 y %2 @@ -684,7 +700,7 @@ command-line options opciones de línea de comandos - + Intro @@ -745,6 +761,10 @@ &Main &Main + + W&allet + Billetera + none ninguno @@ -771,9 +791,21 @@ RPCConsole + + &Information + Información + ReceiveCoinsDialog + + &Amount: + Monto: + + + &Label: + &Etiqueta: + Copy label Copiar etiqueta @@ -785,6 +817,10 @@ ReceiveRequestDialog + + Copy &Address + &Copiar Dirección + Address Dirección @@ -882,6 +918,14 @@ SendCoinsEntry + + A&mount: + Monto: + + + &Label: + &Etiqueta: + ShutdownWindow @@ -905,6 +949,10 @@ Date Fecha + + Transaction + Transacción + Amount Monto @@ -990,6 +1038,14 @@ Backup Failed Copia de seguridad fallida + + There was an error trying to save the wallet data to %1. + Hubo un error intentando guardar los datos de la billetera al %1 + + + The wallet data was successfully saved to %1. + Los datos de la billetera fueron guardados exitosamente al %1 + Backup Successful Copia de seguridad completada diff --git a/src/qt/locale/bitcoin_et.ts b/src/qt/locale/bitcoin_et.ts index 1d6d1b89e5acd..945e4cfa5812c 100644 --- a/src/qt/locale/bitcoin_et.ts +++ b/src/qt/locale/bitcoin_et.ts @@ -329,6 +329,14 @@ Bitcoin Core Bitcoini tuumik + + &About Bitcoin Core + Kirjeldus Bitcoini Tuumast + + + &Command-line options + Käsurea valikud + %n hour(s) %n tund%n tundi @@ -606,7 +614,7 @@ command-line options käsurea valikud - + Intro @@ -639,6 +647,10 @@ Options Valikud + + &Main + &Peamine + MB MB @@ -809,6 +821,10 @@ &Information &Informatsioon + + Debug window + Debugimise aken + General Üldine @@ -947,6 +963,10 @@ ReceiveRequestDialog + + Copy &Address + &Kopeeri Aadress + Address Aadress @@ -1009,6 +1029,10 @@ Send Coins Müntide saatmine + + Insufficient funds! + Liiga suur summa + Quantity: Kogus: @@ -1021,6 +1045,10 @@ Fee: Tasu: + + Transaction Fee: + Tehingu tasu: + Choose... Vali... @@ -1132,6 +1160,10 @@ Message: Sõnum: + + Pay To: + Maksa : + ShutdownWindow @@ -1283,6 +1315,10 @@ Open until %1 Avatud kuni %1 + + %1/offline + %1/offline'is + %1/unconfirmed %1/kinnitamata @@ -1731,10 +1767,30 @@ Wallet options: Rahakoti valikud: + + (default: %u) + (vaikimisi: %u) + + + Cannot resolve -whitebind address: '%s' + Tundmatu -whitebind aadress: '%s' + Information Informatsioon + + Invalid amount for -maxtxfee=<amount>: '%s' + -maxtxfee=<amount> jaoks vigane kogus: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + -minrelaytxfee=<amount> jaoks vigane kogus: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + -mintxfee=<amount> jaoks vigane kogus: '%s' + RPC server options: RPC serveri valikud: diff --git a/src/qt/locale/bitcoin_eu_ES.ts b/src/qt/locale/bitcoin_eu_ES.ts index 4da6cc0dce9a6..ca6b6489d17c8 100644 --- a/src/qt/locale/bitcoin_eu_ES.ts +++ b/src/qt/locale/bitcoin_eu_ES.ts @@ -249,6 +249,10 @@ &Options... &Aukerak... + + &Receiving addresses... + Helbideak jasotzen + Change the passphrase used for wallet encryption Aldatu zorroa enkriptatzeko erabilitako pasahitza @@ -414,10 +418,18 @@ ReceiveCoinsDialog + + &Amount: + Kopurua + &Label: &Etiketa: + + &Message: + Mezua + Copy label Kopiatu etiketa @@ -425,6 +437,10 @@ ReceiveRequestDialog + + Copy &Address + &Kopiatu helbidea + Address Helbidea @@ -437,6 +453,10 @@ Label Etiketa + + Message + Mezua + RecentRequestsTableModel @@ -448,6 +468,10 @@ Label Etiketa + + Message + Mezua + Amount Kopurua @@ -526,6 +550,10 @@ Message: Mezua + + Pay To: + Ordaindu honi: + ShutdownWindow @@ -573,6 +601,14 @@ Date Data + + Message + Mezua + + + Transaction + Transakzioaren + Amount Kopurua diff --git a/src/qt/locale/bitcoin_fa.ts b/src/qt/locale/bitcoin_fa.ts index 3ef9766604e55..7ab3b77da3032 100644 --- a/src/qt/locale/bitcoin_fa.ts +++ b/src/qt/locale/bitcoin_fa.ts @@ -397,6 +397,10 @@ Show the list of used receiving addresses and labels نمایش لیست آدرس های دریافت و لیبل ها + + &Command-line options + گزینه‌های خط‌فرمان + %n active connection(s) to Bitcoin network %n ارتباط فعال با شبکهٔ بیت‌کوین @@ -417,6 +421,14 @@ %n week(s) %n هفته + + %1 and %2 + %1 و %2 + + + %n year(s) + %n سال + %1 behind %1 عقب‌تر @@ -712,7 +724,7 @@ command-line options گزینه‌های خط فرمان - + Intro @@ -743,6 +755,10 @@ Error خطا + + %n GB of free space available + %n گیگابایت فضا موجود است + OpenURIDialog @@ -769,6 +785,10 @@ &Network &شبکه + + W&allet + کیف پول + Expert استخراج @@ -975,6 +995,10 @@ &Information &اطلاعات + + Debug window + پنجرهٔ اشکالزدایی + Using OpenSSL version نسخهٔ OpenSSL استفاده شده @@ -1066,10 +1090,18 @@ ReceiveCoinsDialog + + &Amount: + مبلغ: + &Label: &برچسب: + + &Message: + پیام: + Show نمایش @@ -1093,6 +1125,10 @@ QR Code کد QR + + Copy &Address + &کپی نشانی + Address نشانی @@ -1147,6 +1183,10 @@ Send Coins ارسال سکه + + Insufficient funds! + بود جه نا کافی + Quantity: تعداد: @@ -1175,6 +1215,10 @@ Change: پول خورد: + + Transaction Fee: + هزینهٔ تراکنش: + fast سریع @@ -1290,6 +1334,10 @@ Message: پیام: + + Pay To: + پرداخت به: + ShutdownWindow @@ -1929,6 +1977,18 @@ Information اطلاعات + + Invalid amount for -maxtxfee=<amount>: '%s' + میزان وجه اشتباه برای maxtxfee=<میزان وجه>: %s + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + میزان وجه اشتباه برای minrelaytxfee=<میزان وجه>: %s + + + Invalid amount for -mintxfee=<amount>: '%s' + میزان وجه اشتباه برای mintxfee=<میزان وجه>: %s + Send trace/debug info to console instead of debug.log file اطلاعات ردگیری/اشکال‌زدایی را به جای فایل لاگ اشکال‌زدایی به کنسول بفرستید diff --git a/src/qt/locale/bitcoin_fa_IR.ts b/src/qt/locale/bitcoin_fa_IR.ts index fd9de2e0493d5..8bbfc724243bc 100644 --- a/src/qt/locale/bitcoin_fa_IR.ts +++ b/src/qt/locale/bitcoin_fa_IR.ts @@ -249,6 +249,10 @@ &Change Passphrase... تغییر رمز/پَس فرِیز + + &Receiving addresses... + دریافت آدرس ها + Backup wallet to another location گرفتن نسخه پیشتیبان در آدرسی دیگر @@ -391,6 +395,10 @@ Edit sending address ویرایش حساب ارسال کننده + + The entered address "%1" is already in the address book. + حساب وارد شده «%1» از پیش در دفترچه حساب ها موجود است. + The entered address "%1" is not a valid Bitcoin address. آدرس وارد شده "%1" یک آدرس صحیح برای bitcoin نسشت @@ -434,6 +442,14 @@ Options انتخاب/آپشن + + &Network + شبکه + + + W&allet + کیف پول + &OK و تایید @@ -503,10 +519,18 @@ ReceiveCoinsDialog + + &Amount: + میزان وجه: + &Label: و برچسب + + &Message: + پیام: + Copy label برچسب را کپی کنید @@ -518,6 +542,10 @@ ReceiveRequestDialog + + Copy &Address + کپی آدرس + Address حساب @@ -572,6 +600,10 @@ Send Coins سکه های ارسالی + + Insufficient funds! + وجوه ناکافی + Amount: میزان وجه: @@ -685,6 +717,10 @@ Alt+P Alt و P + + Sign &Message + و امضای پیام + SplashScreen @@ -999,6 +1035,18 @@ The transaction amount is too small to send after the fee has been deducted مبلغ تراکنش کمتر از آن است که پس از کسر هزینه تراکنش قابل ارسال باشد + + Invalid amount for -maxtxfee=<amount>: '%s' + میزان اشتباه است for -maxtxfee=<amount>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + میزان اشتباه است for -minrelaytxfee=<amount>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + میزان اشتباه است for -mintxfee=<amount>: '%s' + RPC server options: گزینه های سرویس دهنده RPC: diff --git a/src/qt/locale/bitcoin_fi.ts b/src/qt/locale/bitcoin_fi.ts index 71ea96644b62f..57987b26ec21b 100644 --- a/src/qt/locale/bitcoin_fi.ts +++ b/src/qt/locale/bitcoin_fi.ts @@ -222,7 +222,15 @@ BanTableModel - + + IP/Netmask + IP/Verkon peite + + + Banned Until + Estetty kunnes + + BitcoinGUI @@ -874,6 +882,34 @@ command-line options komentorivi parametrit + + UI Options: + Käyttöliittymän asetukset: + + + Choose data directory on startup (default: %u) + Valitse datahakemisto käynnistyksen yhteydessä (oletus: %u) + + + Set language, for example "de_DE" (default: system locale) + Aseta kieli, esimerkiksi "de_DE" (oletus: järjestelmän kieli) + + + Start minimized + Käynnistä pienennettynä + + + Set SSL root certificates for payment request (default: -system-) + Aseta maksupyynnöille SSL-juurivarmenteet (oletus: -system-) + + + Show splash screen on startup (default: %u) + Näytä aloitusruutu käynnistyksen yhteydessä (oletus: %u) + + + Reset all settings changes made over the GUI + Nollaa kaikki graafisen käyttöliittymän kautta tehdyt muutokset + Intro @@ -979,6 +1015,14 @@ IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) IP osoite proxille (esim. IPv4: 127.0.0.1 / IPv6: ::1) + + 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. + Minimoi ikkuna ohjelman sulkemisen sijasta kun ikkuna suljetaan. Kun tämä asetus on käytössä, ohjelma suljetaan vain valittaessa valikosta Poistu. + + + The user interface language can be set here. This setting will take effect after restarting Bitcoin Core. + Käyttöliittymän kieli voidaan asettaa tässä. Tämä asetus tulee käyttöön vasta kun Bitcoin Core käynnistetään uudelleen. + 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 |. Ulkopuoliset URL-osoitteet (esim. block explorer,) jotka esiintyvät siirrot-välilehdellä valikossa. %s URL-osoitteessa korvataan siirtotunnuksella. Useampi URL-osoite on eroteltu pystyviivalla |. @@ -1063,6 +1107,34 @@ Port of the proxy (e.g. 9050) Proxyn Portti (esim. 9050) + + Used for reaching peers via: + Vertaisten saavuttamiseen käytettävät verkkotyypit: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Ilmoittaa, mikäli oletetettua SOCKS5-välityspalvelinta käytetään tämän verkkotyypin kautta vertaisten saavuttamiseen. + + + IPv4 + IPv4 + + + IPv6 + IPv6 + + + Tor + Tor + + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + Yhdistä Bitcoin-verkkoon erillisen SOCKS5-välityspalvelimen kautta piilotettuja Tor-palveluja varten. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Käytä erillistä SOCKS5-välityspalvelinta saavuttaaksesi vertaisia piilotettujen Tor-palveluiden kautta: + &Window &Ikkuna @@ -1433,6 +1505,22 @@ Current number of blocks Nykyinen Lohkojen määrä + + Memory Pool + Muistiallas + + + Current number of transactions + Tämänhetkinen rahansiirtojen määrä + + + Memory usage + Muistin käyttö + + + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. + Avaa Bitcoin Coren debug-loki tämänhetkisestä datahakemistosta. Tämä voi viedä muutaman sekunnin suurille lokitiedostoille. + Received Vastaanotetut @@ -1445,10 +1533,18 @@ &Peers &Vertaiset + + Banned peers + Estetyt vertaiset + Select a peer to view detailed information. Valitse vertainen eriteltyjä tietoja varten. + + Whitelisted + Sallittu + Direction Suunta @@ -1457,6 +1553,18 @@ Version Versio + + Starting Block + Alkaen lohkosta + + + Synced Headers + Synkronoidut ylätunnisteet + + + Synced Blocks + Synkronoidut lohkot + User Agent Käyttöliittymä @@ -1485,6 +1593,14 @@ Ping Time Vasteaika + + The duration of a currently outstanding ping. + Tämänhetkisen merkittävän yhteyskokeilun kesto. + + + Ping Wait + Yhteyskokeilun odotus + Time Offset Ajan poikkeama @@ -1533,6 +1649,34 @@ Clear console Tyhjennä konsoli + + &Disconnect Node + &Katkaise yhteys solmukohtaan + + + Ban Node for + Estä solmukohta + + + 1 &hour + 1 &tunti + + + 1 &day + 1 &päivä + + + 1 &week + 1 &viikko + + + 1 &year + 1 &vuosi + + + &Unban Node + &Poista solmukohdan esto + Welcome to the Bitcoin Core RPC console. Tervetuloa Bitcoin Coren RPC-konsoliin. @@ -1561,6 +1705,10 @@ %1 GB %1 GB + + (node id: %1) + (solmukohdan id: %1) + via %1 %1 kautta @@ -1941,6 +2089,10 @@ Copy change Kopioi vaihtoraha + + Total Amount %1 + Kokonaismäärä %1 + or tai @@ -1973,10 +2125,22 @@ Payment request expired. Maksupyyntö on vanhentunut. + + Pay only the required fee of %1 + Maksa vain vaadittu kulu kooltaan %1 + + + Estimated to begin confirmation within %n block(s). + Vahvistuminen alkaa arviolta %n lohkon päästä.Vahvistuminen alkaa arviolta %n lohkon päästä. + The recipient address is not valid. Please recheck. Vastaanottajan osoite ei ole kelvollinen. Tarkistathan uudelleen. + + Duplicate address found: addresses should only be used once each. + Duplikaattiosoite löytyi: kutakin osoitetta pitäisi käyttää vain kerran. + Warning: Invalid Bitcoin address Varoitus: Virheellinen Bitcoin osoite @@ -2505,6 +2669,10 @@ Whether or not a watch-only address is involved in this transaction. Onko rahansiirrossa mukana ainoastaan katseltava osoite vai ei. + + User-defined intent/purpose of the transaction. + Käyttäjän määrittämä käyttötarkoitus rahansiirrolle. + Amount removed from or added to balance. Saldoon lisätty tai siitä vähennetty määrä. @@ -2584,6 +2752,10 @@ Copy transaction ID Kopioi siirtotunnus + + Copy raw transaction + Kopioi rahansiirron raakavedos + Edit label Muokkaa nimeä @@ -2731,10 +2903,22 @@ Accept command line and JSON-RPC commands Hyväksy merkkipohjaiset- ja JSON-RPC-käskyt + + If <category> is not supplied or if <category> = 1, output all debugging information. + Jos <category> on toimittamatta tai jos <category> = 1, tulosta kaikki debug-tieto. + + + Error: A fatal internal error occurred, see debug.log for details + Virhe: Kriittinen sisäinen virhe kohdattiin, katso debug.log lisätietoja varten + Run in the background as a daemon and accept commands Aja taustalla daemonina ja hyväksy komennot + + Unable to start HTTP server. See debug log for details. + HTTP-palvelinta ei voitu käynnistää. Katso debug-lokista lisätietoja. + Accept connections from outside (default: 1 if no -proxy or -connect) Hyväksy yhteyksiä ulkopuolelta (vakioasetus: 1 jos -proxy tai -connect ei määritelty) @@ -2759,6 +2943,18 @@ Unable to bind to %s on this computer. Bitcoin Core is probably already running. Ei voida yhdistää %s tässä tietokoneessa. Bitcoin Core on luultavasti jo käynnissä. + + Use UPnP to map the listening port (default: 1 when listening and no -proxy) + Käytä UPnP:ta kuuntelevan portin kartoitukseen (oletus: 1 kun kuunnellaan ja -proxy ei käytössä) + + + WARNING: abnormally high number of blocks generated, %d blocks received in the last %d hours (%d expected) + VAROITUS: epätavallisen monta lohkoa generoitu, vastaanotettu %d lohkoa viimeisen %d tunnin aikana (odotettavissa %d) + + + WARNING: check your network connection, %d blocks received in the last %d hours (%d expected) + VAROITUS: tarkista verkkoyhteytesi, vastaanotettu %d lohkoa viimeisen %d tunnin aikana (odotettavissa %d) + Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. Varoitus: Tietoverkko ei ole sovussa! Luohijat näyttävät kokevan virhetilanteita. @@ -2771,6 +2967,10 @@ Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. Varoitus: wallet.dat -lompakkotiedosto on korruptoitunut, tiedot pelastettu. Alkuperäinen wallet.dat -lompakkotiedosto on tallennettu wallet.{timestamp}.bak kansioon %s; jos balanssisi tai siirtohistoria on virheellinen, sinun tulisi palauttaa lompakkotiedosto varmuuskopiosta. + + -maxmempool must be at least %d MB + -maxmempool on oltava vähintään %d MB + <category> can be: <category> voi olla: @@ -2803,6 +3003,10 @@ Do you want to rebuild the block database now? Haluatko uudelleenrakentaa lohkotietokannan nyt? + + Enable publish raw transaction in <address> + Ota rahansiirtojen raakavedosten julkaisu käyttöön osoitteessa <address> + Error initializing block database Virhe alustaessa lohkotietokantaa @@ -2919,6 +3123,10 @@ Activating best chain... Aktivoidaan parhainta ketjua... + + Attempt to recover private keys from a corrupt wallet.dat on startup + Yritä palauttaa yksityiset avaimet korruptoituneesta wallet.dat-tiedostosta käynnistyksen yhteydessä + Cannot resolve -whitebind address: '%s' -whitebind -osoitetta '%s' ei voida jäsentää @@ -2943,6 +3151,10 @@ Information Tietoa + + Invalid amount for -maxtxfee=<amount>: '%s' + Virheellinen määrä -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Virheellinen määrä -minrelaytxfee=<amount>: '%s' @@ -2963,6 +3175,10 @@ Receive and display P2P network alerts (default: %u) Vastaanota ja näytä P2P-verkon hälytyksiä (oletus: %u) + + Rescan the block chain for missing wallet transactions on startup + Uudelleenskannaa lohkoketju käynnistyksen yhteydessä puuttuvien lompakon rahansiirtojen vuoksi + Send trace/debug info to console instead of debug.log file Lähetä jäljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan @@ -2979,10 +3195,22 @@ Signing transaction failed Siirron vahvistus epäonnistui + + The transaction amount is too small to pay the fee + Rahansiirron määrä on liian pieni kattaakseen maksukulun + This is experimental software. Tämä on ohjelmistoa kokeelliseen käyttöön. + + Tor control port password (default: empty) + Tor-hallintaportin salasana (oletus: tyhjä) + + + Tor control port to use if onion listening enabled (default: %s) + Tor-hallintaportti jota käytetään jos onion-kuuntelu on käytössä (oletus: %s) + Transaction amount too small Siirtosumma liian pieni @@ -2991,10 +3219,18 @@ Transaction amounts must be positive Siirtosumman tulee olla positiivinen + + Transaction too large for fee policy + Rahansiirto on liian suuri maksukulukäytännölle + Transaction too large Siirtosumma liian iso + + Upgrade wallet to latest format on startup + Päivitä lompakko viimeisimpään formaattiin käynnistyksen yhteydessä + Username for JSON-RPC connections Käyttäjätunnus JSON-RPC-yhteyksille @@ -3007,10 +3243,18 @@ Warning Varoitus + + Whether to operate in a blocks only mode (default: %u) + Toimitaanko tilassa jossa ainoastaan lohkot sallitaan (oletus: %u) + Zapping all transactions from wallet... Tyhjennetään kaikki rahansiirrot lompakosta.... + + ZeroMQ notification options: + ZeroMQ-ilmoitusasetukset: + wallet.dat corrupt, salvage failed wallet.dat -lompakkotiedosto korruptoitunut, korjaaminen epäonnistui @@ -3039,6 +3283,14 @@ Error loading wallet.dat: Wallet corrupted Virhe ladattaessa wallet.dat-tiedostoa: Lompakko vioittunut + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Älä pidä rahansiirtoja muistivarannoissa kauemmin kuin <n> tuntia (oletus: %u) + + + How thorough the block verification of -checkblocks is (0-4, default: %u) + Kuinka läpikäyvä lohkojen -checkblocks -todennus on (0-4, oletus: %u) + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Käytä erillistä SOCKS5-proxyä tavoittaaksesi vertaisia Tor-piilopalveluiden kautta (oletus: %s) @@ -3067,6 +3319,10 @@ Invalid -proxy address: '%s' Virheellinen proxy-osoite '%s' + + Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) + Kuuntele JSON-RPC-yhteyksiä portissa <port> (oletus: %u tai testnet: %u) + Listen for connections on <port> (default: %u or testnet: %u) Kuuntele yhteyksiä portissa <port> (oletus: %u tai testnet: %u) @@ -3075,6 +3331,18 @@ Make the wallet broadcast transactions Aseta lompakko kuuluttamaan rahansiirtoja + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Maksimi yhteyttä kohden käytettävä vastaanottopuskurin koko, <n>*1000 tavua (oletus: %u) + + + Maximum per-connection send buffer, <n>*1000 bytes (default: %u) + Maksimi yhteyttä kohden käytettävä lähetyspuskurin koko, <n>*1000 tavua (oletus: %u) + + + Relay and mine data carrier transactions (default: %u) + Välitä ja louhi dataa kantavia rahansiirtoja (oletus: %u) + Relay non-P2SH multisig (default: %u) Välitä ei-P2SH-multisig (oletus: %u) diff --git a/src/qt/locale/bitcoin_fr.ts b/src/qt/locale/bitcoin_fr.ts index d43e08cf9d1aa..a0b9feb9adfa0 100644 --- a/src/qt/locale/bitcoin_fr.ts +++ b/src/qt/locale/bitcoin_fr.ts @@ -222,7 +222,15 @@ BanTableModel - + + IP/Netmask + IP/masque réseau + + + Banned Until + Banni jusqu'au + + BitcoinGUI @@ -725,6 +733,10 @@ This label turns red if the priority is smaller than "medium". Cette étiquette devient rouge si la priorité est plus basse que « moyenne ». + + This label turns red if any recipient receives an amount smaller than %1. + Cette étiquette devient rouge si un destinataire reçoit un montant inférieur à %1. + Can vary +/- %1 satoshi(s) per input. Peut varier +/- %1 satoshi(s) par entrée. @@ -870,6 +882,34 @@ command-line options options de ligne de commande + + UI Options: + Options de l'IU : + + + Choose data directory on startup (default: %u) + Choisir un répertoire de données au démarrage (par défaut : %u) + + + Set language, for example "de_DE" (default: system locale) + Définir la langue, par exemple « fr_CA » (par défaut : la langue du système) + + + Start minimized + Démarrer minimisé + + + Set SSL root certificates for payment request (default: -system-) + Définir les certificats SSL racine pour les requêtes de paiement (par défaut : -system-) + + + Show splash screen on startup (default: %u) + Afficher l'écran d'accueil au démarrage (par défaut : %u) + + + Reset all settings changes made over the GUI + Réinitialiser tous les changements de paramètres appliqués à l'IUG + Intro @@ -913,7 +953,11 @@ %n GB of free space available %n Go d'espace libre disponible%n Go d'espace libre disponibles - + + (of %n GB needed) + (sur %n Go nécessaire)(sur %n Go nécessaires) + + OpenURIDialog @@ -1063,6 +1107,34 @@ Port of the proxy (e.g. 9050) Port du serveur mandataire (par ex. 9050) + + Used for reaching peers via: + Utilisé pour rejoindre les pairs par : + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + S'affiche, si le mandataire SOCKS5 par défaut fourni est utilisé pour atteindre les pairs par ce type de réseau. + + + IPv4 + IPv4 + + + IPv6 + IPv6 + + + Tor + Tor + + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + Se connecter au réseau Bitcoin au travers d'un mandataire SOCKS5 séparé pour les services cachés de Tor. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Utiliser un mandataire SOCKS5 séparé pour atteindre les pairs grâce aux services cachés de Tor : + &Window &Fenêtre @@ -1329,7 +1401,7 @@ %1 d - %1 d + %1 j %1 h @@ -1433,6 +1505,18 @@ Current number of blocks Nombre actuel de blocs + + Memory Pool + Réserve de mémoire + + + Current number of transactions + Nombre actuel de transactions + + + Memory usage + Utilisation de la mémoire + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Ouvrir le journal de débogage du répertoire de données actuel. Ceci pourrait prendre quelques secondes pour les gros fichiers de journalisation. @@ -1449,10 +1533,18 @@ &Peers &Pairs + + Banned peers + Pairs bannis + Select a peer to view detailed information. Choisir un pair pour voir l'information détaillée. + + Whitelisted + Dans la liste blanche + Direction Direction @@ -1461,6 +1553,18 @@ Version Version + + Starting Block + Bloc de départ + + + Synced Headers + En-têtes synchronisés + + + Synced Blocks + Blocs synchronisés + User Agent Agent utilisateur @@ -1489,6 +1593,14 @@ Ping Time Temps de ping + + The duration of a currently outstanding ping. + La durée d'un ping actuellement en cours. + + + Ping Wait + Attente du ping + Time Offset Décalage temporel @@ -1537,6 +1649,34 @@ Clear console Nettoyer la console + + &Disconnect Node + &Déconnecter le nœud + + + Ban Node for + Bannir le nœud pendant + + + 1 &hour + 1 &heure + + + 1 &day + 1 &jour + + + 1 &week + 1 &semaine + + + 1 &year + 1 &an + + + &Unban Node + &Réhabiliter le nœud + Welcome to the Bitcoin Core RPC console. Bienvenue dans le console RPC de Bitcoin Core. @@ -1565,6 +1705,10 @@ %1 GB %1 Go + + (node id: %1) + (ID de nœud : %1) + via %1 par %1 @@ -1957,6 +2101,10 @@ Copy change Copier la monnaie + + Total Amount %1 + Montant total %1 + or ou @@ -1989,6 +2137,10 @@ Payment request expired. Demande de paiement expirée. + + Pay only the required fee of %1 + Payer seulement les frais exigés de %1 + Estimated to begin confirmation within %n block(s). Il est estimé que la confirmation commencera dans %n bloc.Il est estimé que la confirmation commencera dans %n blocs. @@ -2624,6 +2776,10 @@ Copy transaction ID Copier l'ID de la transaction + + Copy raw transaction + Copier la transaction brute + Edit label Modifier l’étiquette @@ -2771,14 +2927,54 @@ Accept command line and JSON-RPC commands Accepter les commandes de JSON-RPC et de la ligne de commande + + If <category> is not supplied or if <category> = 1, output all debugging information. + Si <category> n'est pas indiqué ou si <category> = 1, extraire toutes les données de débogage. + + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Frais totaux maximaux (en %s) à utiliser en une seule transaction de portefeuille. Les définir trop bas pourrait interrompre les grosses transactions (par défaut : %s) + + + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Veuillez vérifier que l'heure et la date de votre ordinateur sont justes ! Si votre horloge n'est pas à l'heure, Bitcoin Core ne fonctionnera pas correctement. + + + Prune configured below the minimum of %d MiB. Please use a higher number. + L'élagage est configuré au-dessous du minimum de %d Mio. Veuillez utiliser un nombre plus élevé. + + + Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) + Élagage : la dernière synchronisation de portefeuille 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é) + + + Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files) + Réduire les exigences de stockage en élaguant (supprimant) les anciens blocs. Ce mode est incompatible avec -txindex et -rescan. Avertissement : ramener ce paramètre à sa valeur antérieure exige un nouveau téléchargement de la chaîne de blocs en entier (par défaut : 0 = désactiver l'élagage des blocs, >%u = taille cible en Mio à utiliser pour les fichiers de blocs). + + + Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again. + 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. + Error: A fatal internal error occurred, see debug.log for details Erreur : une erreur interne fatale s'est produite. Voir debug.log pour plus de détails + + Fee (in %s/kB) to add to transactions you send (default: %s) + Les frais (en %s/ko) à ajouter aux transactions que vous envoyez (par défaut : %s) + + + Pruning blockstore... + Élagage du magasin de blocs... + Run in the background as a daemon and accept commands Fonctionner en arrière-plan en tant que démon et accepter les commandes + + Unable to start HTTP server. See debug log for details. + Impossible de démarrer le serveur HTTP. Voir le journal de débogage pour plus de détails. + Accept connections from outside (default: 1 if no -proxy or -connect) Accepter les connexions entrantes (par défaut : 1 si aucun -proxy ou -connect ) @@ -2789,7 +2985,7 @@ Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup - Supprimer toutes les transactions du portefeuille et ne récupérer que ces parties de la chaîne de bloc avec -rescan au démarrage + Supprimer toutes les transactions du portefeuille et ne récupérer que ces parties de la chaîne de blocs avec -rescan au démarrage Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. @@ -2803,6 +2999,10 @@ Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Définir le nombre d'exétrons de vérification des scripts (%u à %d, 0 = auto, < 0 = laisser ce nombre de cœurs inutilisés, par défaut : %d) + + 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 + 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. + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Ceci est une pré-version de test - l'utiliser à vos risques et périls - ne pas l'utiliser pour miner ou pour des applications marchandes @@ -2811,6 +3011,10 @@ Unable to bind to %s on this computer. Bitcoin Core is probably already running. Impossible de se lier à %s sur cet ordinateur. Bitcoin Core fonctionne probablement déjà. + + Use UPnP to map the listening port (default: 1 when listening and no -proxy) + Utiliser l'UPnP pour mapper le port d'écoute (par défaut : 1 lors de l'écoute et pas de mandataire -proxy) + WARNING: abnormally high number of blocks generated, %d blocks received in the last %d hours (%d expected) AVERTISSEMENT : un nombre anormalement élevé de blocs a été généré, %d blocs reçus durant les %d dernières heures (%d attendus) @@ -2835,6 +3039,10 @@ Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. Pairs de la liste blanche se connectant à partir du masque réseau ou de l'IP donné. Peut être spécifié plusieurs fois. + + -maxmempool must be at least %d MB + -maxmempool doit être d'au moins %d Mo + <category> can be: <category> peut être : @@ -2867,6 +3075,22 @@ Do you want to rebuild the block database now? Voulez-vous reconstruire la base de données des blocs maintenant ? + + Enable publish hash block in <address> + Activer la publication du bloc de hachage dans <address> + + + Enable publish hash transaction in <address> + Activer la publication de la transaction de hachage dans <address> + + + Enable publish raw block in <address> + Activer la publication du bloc brut dans <address> + + + Enable publish raw transaction in <address> + Activer la publication de la transaction brute dans <address> + Error initializing block database Erreur lors de l'initialisation de la base de données des blocs @@ -2903,6 +3127,10 @@ Invalid -onion address: '%s' Adresse -onion invalide : « %s » + + Keep the transaction memory pool below <n> megabytes (default: %u) + Garder la réserve de mémoire transactionnelle sous <n> mégaoctets (par défaut : %u) + Not enough file descriptors available. Pas assez de descripteurs de fichiers proposés. @@ -2931,10 +3159,26 @@ Specify wallet file (within data directory) Spécifiez le fichier de portefeuille (dans le répertoire de données) + + Unsupported argument -benchmark ignored, use -debug=bench. + Argument non pris en charge -benchmark ignoré, utiliser -debug=bench. + + + Unsupported argument -debugnet ignored, use -debug=net. + Argument non pris en charge -debugnet ignoré, utiliser -debug=net. + + + Unsupported argument -tor found, use -onion. + Argument non pris en charge -tor trouvé, utiliser -onion + Use UPnP to map the listening port (default: %u) Utiliser l'UPnP pour mapper le port d'écoute (par défaut : %u) + + User Agent comment (%s) contains unsafe characters. + Le commentaire d'agent utilisateur (%s) contient des caractères dangereux. + Verifying blocks... Vérification des blocs en cours... @@ -2991,6 +3235,10 @@ Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 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) + + Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s) + 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) + If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) 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) @@ -3047,6 +3295,18 @@ Activating best chain... Activation de la meilleure chaîne... + + Always relay transactions received from whitelisted peers (default: %d) + Toujours relayer les transactions reçues des pairs de la liste blanche (par défaut : %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Tenter de récupérer les clefs privées d'un wallet.dat corrompu lors du démarrage + + + Automatically create Tor hidden service (default: %d) + Créer automatiquement un service caché Tor (par défaut : %d) + Cannot resolve -whitebind address: '%s' Impossible de résoudre l'adresse -whitebind : « %s » @@ -3067,6 +3327,10 @@ Error reading from database, shutting down. Erreur de lecture de la base de données, fermeture en cours. + + Imports blocks from external blk000??.dat file on startup + Importe des blocs depuis un fichier blk000??.dat externe lors du démarrage + Information Informations @@ -3119,6 +3383,14 @@ Receive and display P2P network alerts (default: %u) Recevoir et afficher les alertes du réseau poste à poste (%u par défaut) + + Reducing -maxconnections from %d to %d, because of system limitations. + Réduction de -maxconnections de %d à %d, due aux restrictions du système + + + Rescan the block chain for missing wallet transactions on startup + Réanalyser la chaîne de blocs au démarrage, à la recherche de transactions de portefeuille manquantes + Send trace/debug info to console instead of debug.log file Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log @@ -3147,6 +3419,14 @@ This is experimental software. Ceci est un logiciel expérimental. + + Tor control port password (default: empty) + Mot de passe du port de contrôle Tor (par défaut : vide) + + + Tor control port to use if onion listening enabled (default: %s) + Port de contrôle Tor à utiliser si l'écoute onion est activée (par défaut :%s) + Transaction amount too small Montant de la transaction trop bas @@ -3167,6 +3447,10 @@ Unable to bind to %s on this computer (bind returned error %s) Impossible de se lier à %s sur cet ordinateur (bind a retourné l'erreur %s) + + Upgrade wallet to latest format on startup + Mettre à niveau le portefeuille au démarrage vers le format le plus récent + Username for JSON-RPC connections Nom d'utilisateur pour les connexions JSON-RPC @@ -3179,10 +3463,18 @@ Warning Avertissement + + Whether to operate in a blocks only mode (default: %u) + Faut-il fonctionner en mode blocs seulement (par défaut : %u) + Zapping all transactions from wallet... Supprimer toutes les transactions du portefeuille... + + ZeroMQ notification options: + Options de notification ZeroMQ + wallet.dat corrupt, salvage failed wallet.dat corrompu, la récupération a échoué @@ -3215,6 +3507,26 @@ (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) (1 = conserver les métadonnées de transmission, par ex. les informations du propriétaire du compte et de la demande de paiement, 2 = abandonner les métadonnées de transmission) + + -maxtxfee is set very high! Fees this large could be paid on a single transaction. + -maxtxfee est défini très haut ! Des frais aussi élevés pourraient être payés en une seule transaction. + + + -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. + -paytxfee est réglé sur un montant très élevé ! Il s'agit des frais de transaction que vous payerez si vous envoyez une transaction. + + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Ne pas conserver de transactions dans la réserve de mémoire plus de <n> heures (par défaut : %u) + + + Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + Une erreur est survenue lors de la lecture de wallet.dat ! Toutes les clefs ont été lues correctement, mais les données transactionnelles ou les entrées du carnet d'adresses sont peut-être manquantes ou incorrectes. + + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + 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) + How thorough the block verification of -checkblocks is (0-4, default: %u) Degré de profondeur de la vérification des blocs -checkblocks (0-4, par défaut : %u) @@ -3231,10 +3543,30 @@ Output debugging information (default: %u, supplying <category> is optional) Extraire les informations de débogage (par défaut : %u, fournir <category> est optionnel) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Prendre en charge le filtrage des blocs et des transactions avec les filtres bloom (par défaut : %u) + + + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. + 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. + + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + Tente de garder le trafic sortant sous la cible donnée (en Mio par 24 h), 0 = sans limite (par défaut : %d) + + + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + 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. + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Utiliser un serveur mandataire SOCKS5 séparé pour atteindre les pairs par les services cachés de Tor (par défaut : %s) + + 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. This option can be specified multiple times + Nom d'utilisateur et mot de passe haché pour les connexions JSON-RPC. Le champ <userpw> vient au format : <USERNAME>:<SALT>$<HASH>. Un script python canonique est inclus dans share/rpcuser. Cette option peut être spécifiée plusieurs fois. + (default: %s) (par défaut : %s) @@ -3307,6 +3639,10 @@ Set minimum block size in bytes (default: %u) Définir la taille de bloc minimale en octets (par défaut : %u) + + Set the number of threads to service RPC calls (default: %d) + Définir le nombre d'exétrons pour desservir les appels RPC (par défaut : %d) + Specify configuration file (default: %s) Spécifier le fichier de configuration (par défaut : %s) diff --git a/src/qt/locale/bitcoin_fr_CA.ts b/src/qt/locale/bitcoin_fr_CA.ts index 75f970f554c7e..7e6925f96f683 100644 --- a/src/qt/locale/bitcoin_fr_CA.ts +++ b/src/qt/locale/bitcoin_fr_CA.ts @@ -13,6 +13,10 @@ &Delete &Supprimer + + Sending addresses + envoyer adresse de reception + Comma separated file (*.csv) Fichier séparé par une virgule (*.csv) @@ -75,6 +79,14 @@ CoinControlDialog + + (un)select all + Toute sélectionner + + + Copy address + copier l'adresse + (no label) (pas de record) @@ -82,6 +94,14 @@ EditAddressDialog + + &Label + Record + + + &Address + Addresse + FreespaceChecker @@ -91,6 +111,10 @@ Intro + + Welcome + Bienvenue + OpenURIDialog @@ -178,6 +202,10 @@ TransactionView + + Copy address + copier l'adresse + Comma separated file (*.csv) Fichier séparé par une virgule (*.csv) diff --git a/src/qt/locale/bitcoin_fr_FR.ts b/src/qt/locale/bitcoin_fr_FR.ts index c55b08b646733..df63243353931 100644 --- a/src/qt/locale/bitcoin_fr_FR.ts +++ b/src/qt/locale/bitcoin_fr_FR.ts @@ -362,10 +362,18 @@ ReceiveCoinsDialog + + &Amount: + Montant : + &Label: &Étiquette : + + &Message: + Message : + Copy label Copier l'étiquette @@ -427,6 +435,10 @@ Send Coins Envoyer des pièces + + Insufficient funds! + Fonds insuffisants + Amount: Montant : @@ -494,6 +506,10 @@ Message: Message : + + Pay To: + Payer à : + ShutdownWindow @@ -520,6 +536,10 @@ Enter the message you want to sign here Entrez ici le message que vous désirez signer + + Sign &Message + &Signer le message + SplashScreen diff --git a/src/qt/locale/bitcoin_gl.ts b/src/qt/locale/bitcoin_gl.ts index 0b0800e7421d4..96d4adeba9df8 100644 --- a/src/qt/locale/bitcoin_gl.ts +++ b/src/qt/locale/bitcoin_gl.ts @@ -261,6 +261,10 @@ &Change Passphrase... &Cambiar contrasinal... + + &Receiving addresses... + Direccións para recibir + Importing blocks from disk... Importando bloques de disco... @@ -369,6 +373,10 @@ Open a bitcoin: URI or payment request Abrir un bitcoin: URI ou solicitude de pago + + &Command-line options + Opcións da liña de comandos + No block source available... Non hai orixe de bloques dispoñible... @@ -696,7 +704,7 @@ command-line options opcións da liña de comandos - + Intro @@ -765,6 +773,10 @@ &Network &Rede + + W&allet + Moedeiro + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Abrir automáticamente o porto do cliente Bitcoin no router. Esto so funciona se o teu router soporta UPnP e está habilitado. @@ -967,6 +979,10 @@ &Information &Información + + Debug window + Ventana de Depuración + Using OpenSSL version Usar versión OpenSSL @@ -1187,6 +1203,10 @@ Send Coins Moedas Enviadas + + Insufficient funds! + Fondos insuficientes + Quantity: Cantidade: @@ -1211,6 +1231,10 @@ Change: Cambiar: + + Transaction Fee: + Tarifa de transacción: + Send to multiple recipients at once Enviar a múltiples receptores á vez @@ -1350,6 +1374,10 @@ Remove this entry Eliminar esta entrada + + Message: + Mensaxe: + Enter a label for this address to add it to the list of used addresses Introduce unha etiqueta para esta dirección para engadila á listaxe de direccións empregadas @@ -2041,10 +2069,18 @@ Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executar comando cando se recibe unha alerta relevante ou vemos un fork realmente longo (%s no cmd é substituído pola mensaxe) + + Cannot resolve -whitebind address: '%s' + Non se pode resolver dirección -whitebind: '%s' + Information Información + + Invalid amount for -maxtxfee=<amount>: '%s' + Cantidade inválida para -maxtxfee=<cantidade>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Cantidade inválida para -minrelaytxfee=<cantidade>: '%s' diff --git a/src/qt/locale/bitcoin_he.ts b/src/qt/locale/bitcoin_he.ts index 7db2a9dd34710..926d20620694e 100644 --- a/src/qt/locale/bitcoin_he.ts +++ b/src/qt/locale/bitcoin_he.ts @@ -417,6 +417,10 @@ %1 and %2 %1 ו%2 + + %1 behind + %1 מאחור + Last received block was generated %1 ago. המקטע האחרון שהתקבל נוצר לפני %1. @@ -623,6 +627,10 @@ lowest הנמוך ביותר + + (%1 locked) + (%1 נעול) + none ללא @@ -772,7 +780,7 @@ command-line options אפשרויות שורת פקודה - + Intro @@ -1659,6 +1667,10 @@ Custom change address כתובת לעודף מותאמת אישית + + Transaction Fee: + עמלת העברה: + Send to multiple recipients at once שליחה למספר מוטבים בו־זמנית @@ -2653,6 +2665,10 @@ Initialization sanity check failed. Bitcoin Core is shutting down. בדיקת התקינות ההתחלתית נכשלה. ליבת ביטקוין תיסגר כעת. + + Invalid amount for -maxtxfee=<amount>: '%s' + כמות לא תקינה עבור -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' כמות לא תקינה עבור -paytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_hi_IN.ts b/src/qt/locale/bitcoin_hi_IN.ts index fbdaf1ba7c5a7..377ff3a3faf10 100644 --- a/src/qt/locale/bitcoin_hi_IN.ts +++ b/src/qt/locale/bitcoin_hi_IN.ts @@ -334,6 +334,10 @@ Options विकल्प + + W&allet + वॉलेट + &OK &ओके @@ -385,6 +389,10 @@ ReceiveCoinsDialog + + &Amount: + राशि : + &Label: लेबल: @@ -400,6 +408,10 @@ ReceiveRequestDialog + + Copy &Address + &पता कॉपी करे + Address पता @@ -501,6 +513,10 @@ Alt+P Alt-P + + Pay To: + प्राप्तकर्ता: + ShutdownWindow diff --git a/src/qt/locale/bitcoin_hr.ts b/src/qt/locale/bitcoin_hr.ts index 624cbbbc233c0..413dc21857344 100644 --- a/src/qt/locale/bitcoin_hr.ts +++ b/src/qt/locale/bitcoin_hr.ts @@ -774,7 +774,7 @@ command-line options opcije programa u naredbenoj liniji - + Intro @@ -1013,6 +1013,10 @@ &Information &Informacije + + Debug window + Konzola za dijagnostiku + Using OpenSSL version OpenSSL verzija u upotrebi @@ -1213,6 +1217,10 @@ Send Coins Slanje novca + + Insufficient funds! + Nedovoljna sredstva + Quantity: Količina: @@ -1237,6 +1245,10 @@ Change: Vraćeno: + + Transaction Fee: + Naknada za transakciju: + Send to multiple recipients at once Pošalji novce većem broju primatelja u jednoj transakciji @@ -1366,6 +1378,10 @@ Signature Potpis + + Sign &Message + &Potpišite poruku + Clear &All Obriši &sve @@ -1374,6 +1390,10 @@ &Verify Message &Potvrdite poruku + + Verify &Message + &Potvrdite poruku + Wallet unlock was cancelled. Otključavanje novčanika je otkazano. @@ -1779,6 +1799,18 @@ Information Informacija + + Invalid amount for -maxtxfee=<amount>: '%s' + Nevaljali iznos za opciju -maxtxfee=<iznos>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + Nevaljali iznos za opciju -minrelaytxfee=<iznos>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Nevaljali iznos za opciju -mintxfee=<iznos>: '%s' + Send trace/debug info to console instead of debug.log file Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku diff --git a/src/qt/locale/bitcoin_hu.ts b/src/qt/locale/bitcoin_hu.ts index 9825a28543696..ab4517ccfabb0 100644 --- a/src/qt/locale/bitcoin_hu.ts +++ b/src/qt/locale/bitcoin_hu.ts @@ -866,7 +866,7 @@ command-line options parancssoros opciók - + Intro @@ -1011,6 +1011,18 @@ Port of the proxy (e.g. 9050) Proxy portja (pl.: 9050) + + IPv4 + IPv4 + + + IPv6 + IPv6 + + + Tor + Tor + &Window &Ablak @@ -1277,6 +1289,10 @@ Current number of blocks Aktuális blokkok száma + + Memory usage + Memóriahasználat + Received Fogadott @@ -1365,6 +1381,22 @@ Clear console Konzol törlése + + 1 &hour + 1 &óra + + + 1 &day + 1 &nap + + + 1 &week + 1 &hét + + + 1 &year + 1 &év + Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen. Navigálhat a fel és le nyilakkal, és <b>Ctrl-L</b> -vel törölheti a képernyőt. @@ -1621,6 +1653,14 @@ Hide Elrejtés + + Recommended: + Ajánlott: + + + Custom: + Egyéni: + normal normál @@ -1773,6 +1813,10 @@ Message: Üzenet: + + Pay To: + Címzett: + Memo: Jegyzet: @@ -1843,6 +1887,10 @@ &Verify Message Üzenet ellenőrzése + + Verify &Message + Üzenet ellenőrzése + The entered address is invalid. A megadott cím nem érvényes. @@ -2185,6 +2233,10 @@ Show transaction details Tranzakciós részletek megjelenítése + + Watch-only + Csak megfigyelés + Exporting Failed Az exportálás sikertelen volt @@ -2372,6 +2424,10 @@ You need to rebuild the database using -reindex to change -txindex Az adatbázist újra kell építeni -reindex használatával (módosítás -tindex). + + Cannot resolve -whitebind address: '%s' + Külső cím (-whitebind address) feloldása nem sikerült: '%s' + Copyright (C) 2009-%i The Bitcoin Core Developers Copyright (C) 2009-%i A Bitcoin Core Fejlesztői @@ -2384,6 +2440,10 @@ Information Információ + + Invalid amount for -maxtxfee=<amount>: '%s' + Érvénytelen -maxtxfee=<amount>: '%s' összeg + Invalid amount for -minrelaytxfee=<amount>: '%s' Érvénytelen -minrelaytxfee=<amount>: '%s' összeg diff --git a/src/qt/locale/bitcoin_id_ID.ts b/src/qt/locale/bitcoin_id_ID.ts index 4124ef09514e4..1b626fbf239dc 100644 --- a/src/qt/locale/bitcoin_id_ID.ts +++ b/src/qt/locale/bitcoin_id_ID.ts @@ -253,6 +253,10 @@ &Options... &Pilihan... + + &Encrypt Wallet... + &Enkripsi Dompet... + &Backup Wallet... &Cadangkan Dompet... @@ -794,6 +798,10 @@ About Bitcoin Core Mengenai Bitcoin Core + + Command-line options + pilihan Perintah-baris + Usage: Penggunaan: @@ -802,7 +810,7 @@ command-line options pilihan perintah-baris - + Intro @@ -1555,6 +1563,10 @@ Custom change address Alamat uang kembali yang kustom + + Transaction Fee: + Biaya Transaksi: + Recommended: Disarankan @@ -1583,6 +1595,10 @@ Clear all fields of the form. Hapus informasi dari form. + + Clear &All + Hapus &Semua + Balance: Saldo: @@ -1804,6 +1820,10 @@ Reset all sign message fields Hapus semua bidang penanda pesan + + Clear &All + Hapus &Semua + &Verify Message &Verifikasi Pesan @@ -2453,6 +2473,10 @@ Cannot obtain a lock on data directory %s. Bitcoin Core is probably already running. Tidak bisa mengunci data directory %s. Kemungkinan Bitcoin Core sudah mulai. + + Cannot resolve -whitebind address: '%s' + Tidak dapat menyelesaikan alamat -whitebind: '%s' + Connect through SOCKS5 proxy Hubungkan melalui proxy SOCKS5 @@ -2461,6 +2485,10 @@ Information Informasi + + Invalid amount for -maxtxfee=<amount>: '%s' + Nilai salah untuk -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Nilai yang salah untuk -minrelaytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_it.ts b/src/qt/locale/bitcoin_it.ts index 5ec6e480ba55b..d510b1063b854 100644 --- a/src/qt/locale/bitcoin_it.ts +++ b/src/qt/locale/bitcoin_it.ts @@ -222,7 +222,15 @@ BanTableModel - + + IP/Netmask + IP/Netmask + + + Banned Until + Bannato fino a + + BitcoinGUI @@ -874,6 +882,34 @@ command-line options opzioni della riga di comando + + UI Options: + Opzioni interfaccia: + + + Choose data directory on startup (default: %u) + Seleziona la directory dei dati all'avvio (default: %u) + + + Set language, for example "de_DE" (default: system locale) + Imposta la lingua, ad esempio "it_IT" (default: locale di sistema) + + + Start minimized + Avvia ridotto a icona + + + Set SSL root certificates for payment request (default: -system-) + Imposta un certificato SSL root per le richieste di pagamento (default: -system-) + + + Show splash screen on startup (default: %u) + Mostra schermata iniziale all'avvio (default: %u) + + + Reset all settings changes made over the GUI + Reset di tutte le modifiche alle impostazioni eseguite da interfaccia grafica + Intro @@ -913,7 +949,11 @@ Error Errore - + + (of %n GB needed) + (di %nGB richiesti)(%n GB richiesti) + + OpenURIDialog @@ -1064,6 +1104,34 @@ Per specificare più URL separarli con una barra verticale "|". Port of the proxy (e.g. 9050) Porta del proxy (ad es. 9050) + + Used for reaching peers via: + Utilizzata per connettersi attraverso: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Mostra se la proxy SOCKS5 fornita viene utilizzata per raggiungere i peers attraverso questo tipo di rete. + + + IPv4 + IPv4 + + + IPv6 + IPv6 + + + Tor + Tor + + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + Connette alla rete Bitcoin attraverso un proxy SOCKS5 separato per Tor. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Usa un proxy SOCKS5 separato per connettersi ai peers attraverso Tor: + &Window &Finestra @@ -1434,6 +1502,18 @@ Per specificare più URL separarli con una barra verticale "|". Current number of blocks Numero attuale di blocchi + + Memory Pool + Memory Pool + + + Current number of transactions + Numero attuale di transazioni + + + Memory usage + Utilizzo memoria + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Apre il file log di debug di Bitcoin Core dalla cartella dati attuale. Questa azione può richiedere alcuni secondi per file log di grandi dimensioni. @@ -1450,10 +1530,18 @@ Per specificare più URL separarli con una barra verticale "|". &Peers &Peer + + Banned peers + Peers bannati + Select a peer to view detailed information. Seleziona un peer per visualizzare informazioni più dettagliate. + + Whitelisted + Whitelisted/sicuri + Direction Direzione @@ -1462,6 +1550,18 @@ Per specificare più URL separarli con una barra verticale "|". Version Versione + + Starting Block + Blocco di partenza + + + Synced Headers + Headers sincronizzati + + + Synced Blocks + Blocchi sincronizzati + User Agent User Agent @@ -1490,6 +1590,14 @@ Per specificare più URL separarli con una barra verticale "|". Ping Time Tempo di Ping + + The duration of a currently outstanding ping. + La durata di un ping attualmente in corso. + + + Ping Wait + Attesa ping + Time Offset Scarto Temporale @@ -1538,6 +1646,34 @@ Per specificare più URL separarli con una barra verticale "|". Clear console Cancella console + + &Disconnect Node + &Nodo Disconnesso + + + Ban Node for + Nodo Bannato perché + + + 1 &hour + 1 &ora + + + 1 &day + 1 &giorno + + + 1 &week + 1 &settimana + + + 1 &year + 1 &anno + + + &Unban Node + &Elimina Ban Nodo + Welcome to the Bitcoin Core RPC console. Benvenuto nella console RPC di Bitcoin Core. @@ -1566,6 +1702,10 @@ Per specificare più URL separarli con una barra verticale "|". %1 GB %1 GB + + (node id: %1) + (id nodo: %1) + via %1 via %1 @@ -1958,6 +2098,10 @@ Per specificare più URL separarli con una barra verticale "|". Copy change Copia resto + + Total Amount %1 + Ammontare Totale %1 + or o @@ -1990,6 +2134,14 @@ Per specificare più URL separarli con una barra verticale "|". Payment request expired. Richiesta di pagamento scaduta. + + Pay only the required fee of %1 + Paga solamente la commissione richiesta di %1 + + + Estimated to begin confirmation within %n block(s). + Inizio delle conferme stimato entro %n blocco.Inizio delle conferme stimato entro %n blocchi. + The recipient address is not valid. Please recheck. L'indirizzo del beneficiario non è valido. Si prega di ricontrollare. @@ -2621,6 +2773,10 @@ Per specificare più URL separarli con una barra verticale "|". Copy transaction ID Copia l'ID transazione + + Copy raw transaction + Copia la transazione raw + Edit label Modifica l'etichetta @@ -2768,14 +2924,54 @@ Per specificare più URL separarli con una barra verticale "|". Accept command line and JSON-RPC commands Accetta comandi da riga di comando e JSON-RPC + + If <category> is not supplied or if <category> = 1, output all debugging information. + Se <category> non è specificato oppure se <category> = 1, mostra tutte le informazioni di debug. + + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Totale massimo di commissioni (in %s) da usare in una singola transazione del wallet; valori troppo bassi possono abortire grandi transazioni (default: %s) + + + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Per favore controllate che la data del computer e l'ora siano corrette. Se il vostro orologio è sbagliato Bitcoin non funzionerà correttamente. + + + Prune configured below the minimum of %d MiB. Please use a higher number. + La modalità prune è configurata al di sotto del minimo di %d MB. Si prega di utilizzare un valore più elevato. + + + Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) + 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) + + + Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files) + Riduce i requisiti di spazio di archiviazione attraverso la rimozione dei vecchi blocchi (pruning). Questa modalità è incompatibile con l'opzione -txindex e -rescan. Attenzione: ripristinando questa opzione l'intera blockchain dovrà essere riscaricata. (default: 0 = disabilita il pruning, >%u = dimensione desiderata in MiB per i file dei blocchi) + + + Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again. + Non è possibile un Rescan in modalità pruned. Sarà necessario utilizzare -reindex che farà scaricare nuovamente tutta la blockchain. + Error: A fatal internal error occurred, see debug.log for details Errore: si è presentato un errore interno fatale, consulta il file debug.log per maggiori dettagli + + Fee (in %s/kB) to add to transactions you send (default: %s) + Commissione (in %s/kB) da aggiungere alle transazioni inviate (default: %s) + + + Pruning blockstore... + Pruning del blockstore... + Run in the background as a daemon and accept commands Esegui in background come demone ed accetta i comandi + + Unable to start HTTP server. See debug log for details. + Impossibile avviare il server HTTP. Dettagli nel log di debug. + Accept connections from outside (default: 1 if no -proxy or -connect) Accetta connessioni dall'esterno (predefinito: 1 se -proxy o -connect non sono utilizzati) @@ -2800,6 +2996,10 @@ Per specificare più URL separarli con una barra verticale "|". Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Imposta il numero di thread per la verifica degli script (da %u a %d, 0 = automatico, <0 = lascia questo numero di core liberi, predefinito: %d) + + 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 + 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 + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Questa versione è una compilazione pre-rilascio - usala a tuo rischio - non utilizzarla per la generazione o per applicazioni di commercio @@ -2808,6 +3008,10 @@ Per specificare più URL separarli con una barra verticale "|". Unable to bind to %s on this computer. Bitcoin Core is probably already running. Impossibile associarsi a %s su questo computer. Probabilmente Bitcoin Core è già in esecuzione. + + Use UPnP to map the listening port (default: 1 when listening and no -proxy) + Utilizza UPnP per mappare la porta in ascolto (default: 1 quando in ascolto e -proxy non è specificato) + WARNING: abnormally high number of blocks generated, %d blocks received in the last %d hours (%d expected) ATTENZIONE, il numero di blocchi generati è insolitamente elevato: %d blocchi ricevuti nelle ultime %d ore (%d previsti) @@ -2832,6 +3036,10 @@ Per specificare più URL separarli con una barra verticale "|". Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. Inserisce in whitelist i peer che si connettono da un dato indirizzo IP o netmask. Può essere specificato più volte. + + -maxmempool must be at least %d MB + -maxmempool deve essere almeno %d MB + <category> can be: Valori possibili per <category>: @@ -2864,6 +3072,22 @@ Per specificare più URL separarli con una barra verticale "|". Do you want to rebuild the block database now? Vuoi ricostruire ora il database dei blocchi? + + Enable publish hash block in <address> + Abilita pubblicazione hash blocco in <address> + + + Enable publish hash transaction in <address> + Abilità pubblicazione hash transazione in <address> + + + Enable publish raw block in <address> + Abilita pubblicazione blocchi raw in <address> + + + Enable publish raw transaction in <address> + Abilita pubblicazione transazione raw in <address> + Error initializing block database Errore durante l'inizializzazione del database dei blocchi @@ -2900,6 +3124,10 @@ Per specificare più URL separarli con una barra verticale "|". Invalid -onion address: '%s' Indirizzo -onion non valido: '%s' + + Keep the transaction memory pool below <n> megabytes (default: %u) + Mantieni la memory pool delle transazioni al di sotto di <n> megabytes (default: %u) + Not enough file descriptors available. Non ci sono abbastanza descrittori di file disponibili. @@ -2928,10 +3156,26 @@ Per specificare più URL separarli con una barra verticale "|". Specify wallet file (within data directory) Specifica il file del portamonete (all'interno della cartella dati) + + Unsupported argument -benchmark ignored, use -debug=bench. + Ignorata opzione -benchmark non supportata, utilizzare -debug=bench. + + + Unsupported argument -debugnet ignored, use -debug=net. + Argomento -debugnet ignorato in quanto non supportato, usare -debug=net. + + + Unsupported argument -tor found, use -onion. + Rilevato argomento -tor non supportato, utilizzare -onion. + Use UPnP to map the listening port (default: %u) Usa UPnP per mappare la porta di ascolto (predefinito: %u) + + User Agent comment (%s) contains unsafe characters. + Il commento del User Agent (%s) contiene caratteri non sicuri. + Verifying blocks... Verifica blocchi... @@ -2988,6 +3232,10 @@ Per specificare più URL separarli con una barra verticale "|". Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) 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) + + Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s) + Le commissioni (in %s/kB) inferiori a questo valore sono considerate pari a zero per trasmissione, mining e creazione della transazione (default: %s) + If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) 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) @@ -3044,6 +3292,18 @@ Per specificare più URL separarli con una barra verticale "|". Activating best chain... Attivazione della blockchain migliore... + + Always relay transactions received from whitelisted peers (default: %d) + Trasmetti sempre le transazioni ricevute da peers whitelisted (default: %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Prova a recuperare le chiavi private da un wallet corrotto all'avvio + + + Automatically create Tor hidden service (default: %d) + Crea automaticamente il servizio Tor (default: %d) + Cannot resolve -whitebind address: '%s' Impossibile risolvere indirizzo -whitebind: '%s' @@ -3064,6 +3324,10 @@ Per specificare più URL separarli con una barra verticale "|". Error reading from database, shutting down. Errore durante lalettura del database. Arresto in corso. + + Imports blocks from external blk000??.dat file on startup + Importa blocchi da un file blk000??.dat esterno all'avvio + Information Informazioni @@ -3116,6 +3380,14 @@ Per specificare più URL separarli con una barra verticale "|". Receive and display P2P network alerts (default: %u) Ricevi e visualizza gli alerts della rete P2P (default: %u) + + Reducing -maxconnections from %d to %d, because of system limitations. + Riduzione -maxconnections da %d a %d a causa di limitazioni di sistema. + + + Rescan the block chain for missing wallet transactions on startup + Ripete la scansione della block chain per individuare le transazioni che mancano dal wallet all'avvio + Send trace/debug info to console instead of debug.log file Invia le informazioni di trace/debug alla console invece che al file debug.log @@ -3144,6 +3416,14 @@ Per specificare più URL separarli con una barra verticale "|". This is experimental software. Questo è un software sperimentale. + + Tor control port password (default: empty) + Password porta controllo Tor (default: empty) + + + Tor control port to use if onion listening enabled (default: %s) + Porta di controllo Tor da usare se in ascolto su onion (default: %s) + Transaction amount too small Importo transazione troppo piccolo @@ -3164,6 +3444,10 @@ Per specificare più URL separarli con una barra verticale "|". Unable to bind to %s on this computer (bind returned error %s) Impossibile associarsi a %s su questo computer (l'associazione ha restituito l'errore %s) + + Upgrade wallet to latest format on startup + Aggiorna il wallet all'ultimo formato all'avvio + Username for JSON-RPC connections Nome utente per connessioni JSON-RPC @@ -3176,10 +3460,18 @@ Per specificare più URL separarli con una barra verticale "|". Warning Attenzione + + Whether to operate in a blocks only mode (default: %u) + Imposta se operare in modalità solo blocchi (default: %u) + Zapping all transactions from wallet... Eliminazione dal portamonete di tutte le transazioni... + + ZeroMQ notification options: + Opzioni di notifica ZeroMQ + wallet.dat corrupt, salvage failed wallet.dat corrotto, recupero fallito @@ -3212,6 +3504,26 @@ Per specificare più URL separarli con una barra verticale "|". (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) (1 = mantiene metadati tx, ad es. proprietario account ed informazioni di richiesta di pagamento, 2 = scarta metadati tx) + + -maxtxfee is set very high! Fees this large could be paid on a single transaction. + -maxtxfee è impostato molto alto! Commissioni così alte possono venir pagate anche su una singola transazione. + + + -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. + -paytxfee è impostato su un valore molto elevato. Questa è la commissione che si paga quando si invia una transazione. + + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Non mantenere le transazioni nella mempool più a lungo di <n> ore (default: %u) + + + Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + Errore di lettura di wallet.dat! Tutte le chiavi sono state lette correttamente, ma i dati delle transazioni o della rubrica potrebbero essere mancanti o non corretti. + + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Le commissioni (in %s/kB) inferiori a questo valore sono considerate pari a zero per la creazione della transazione (default: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Determina quanto sarà approfondita la verifica da parte di -checkblocks (0-4, predefinito: %u) @@ -3228,10 +3540,30 @@ Per specificare più URL separarli con una barra verticale "|". Output debugging information (default: %u, supplying <category> is optional) Emette informazioni di debug (predefinito: %u, fornire <category> è opzionale) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Supporta filtraggio di blocchi e transazioni con filtri bloom (default: %u) + + + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. + La lunghezza totale della stringa di network version (%i) eccede la lunghezza massima (%i). Ridurre il numero o la dimensione di uacomments. + + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + Cerca di mantenere il traffico in uscita al di sotto della soglia scelta (in MiB ogni 24h), 0 = nessun limite (default: %d) + + + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Argomento -socks non supportato. Non è più possibile impostare la versione SOCKS, solamente i proxy SOCKS5 sono supportati. + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Usa un proxy SOCKS5 a parte per raggiungere i peer attraverso gli hidden services di Tor (predefinito: %s) + + 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. This option can be specified multiple times + Username e hash password per connessioni JSON-RPC. Il campo <userpw> utilizza il formato: <USERNAME>:<SALT>$<HASH>. Uno script python standard è incluso in share/rpcuser. Questa opzione può essere specificata più volte + (default: %s) (predefinito: %s) diff --git a/src/qt/locale/bitcoin_ja.ts b/src/qt/locale/bitcoin_ja.ts index 37306da5a7b18..4344fd0436323 100644 --- a/src/qt/locale/bitcoin_ja.ts +++ b/src/qt/locale/bitcoin_ja.ts @@ -882,6 +882,34 @@ command-line options コマンドライン オプション + + UI Options: + UIオプション: + + + Choose data directory on startup (default: %u) + 起動時にデータ ディレクトリを選ぶ (初期値: %u) + + + Set language, for example "de_DE" (default: system locale) + 言語設定 例: "de_DE" (初期値: システムの言語) + + + Start minimized + 最小化された状態で起動する + + + Set SSL root certificates for payment request (default: -system-) + 支払いリクエスト用にSSLルート証明書を設定する (デフォルト:-system-) + + + Show splash screen on startup (default: %u) + 起動時にスプラッシュ画面を表示する (初期値: %u) + + + Reset all settings changes made over the GUI + GUI 経由で行われた設定の変更を全てリセット + Intro @@ -1477,6 +1505,18 @@ Current number of blocks 現在のブロック数 + + Memory Pool + メモリ・プール + + + Current number of transactions + 現在のトランザクション数 + + + Memory usage + メモリ使用量 + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. 現在のデータディレクトリからBitcoin Coreのデバッグ用ログファイルを開きます。ログファイルが巨大な場合、数秒かかることがあります。 @@ -3484,6 +3524,10 @@ Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. wallet.dat の読み込みエラー! すべてのキーは正しく読み取れますが、取引データやアドレス帳のエントリが失われたか、正しくない可能性があります。 + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + トランザクション作成の際、この値未満の手数料 (%s/kB単位) はゼロであるとみなす (デフォルト: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) -checkblocks のブロックの検証レベル (0-4, 初期値: %u) @@ -3500,6 +3544,10 @@ Output debugging information (default: %u, supplying <category> is optional) デバッグ情報を出力する (初期値: %u, <category> の指定は任意です) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Bloomフィルタによる、ブロックおよびトランザクションのフィルタリングを有効化する (初期値: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. ネットワークバージョン文字 (%i) の長さが最大の長さ (%i) を超えています。UAコメントの数や長さを削減してください。 @@ -3516,6 +3564,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Tor 秘匿サービスを通し、別々の SOCKS5 プロキシを用いることでピアに到達する (初期値: %s) + + 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. This option can be specified multiple times + JSON-RPC接続時のユーザ名とハッシュ化されたパスワード。<userpw> フィールドのフォーマットは <USERNAME>:<SALT>$<HASH>。標準的な Python スクリプトが share/rpcuser 内に含まれています。このオプションは複数回指定できます。 + (default: %s) (デフォルト: %s) diff --git a/src/qt/locale/bitcoin_ka.ts b/src/qt/locale/bitcoin_ka.ts index 68666cfb25935..11c73ec76794b 100644 --- a/src/qt/locale/bitcoin_ka.ts +++ b/src/qt/locale/bitcoin_ka.ts @@ -748,7 +748,7 @@ command-line options კომანდების ზოლის ოპციები - + Intro @@ -763,6 +763,10 @@ As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. ეს პროგრამის პირველი გაშვებაა; შეგიძლიათ მიუთითოთ, სად შეინახოს მონაცემები Bitcoin Core-მ. + + Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + Bitcoin Core გადმოტვირთავს და შეინახავს Bitcoin-ის ბლოკთა ჯაჭვს. მითითებულ კატალოგში დაგროვდება სულ ცოტა %1 გბ მონაცემები, და მომავალში უფრო გაიზრდება. საფულეც ამავე კატალოგში შეინახება. + Use the default data directory ნაგულისხმევი კატალოგის გამოყენება @@ -1431,6 +1435,10 @@ Custom change address ხურდის მისამართი + + Transaction Fee: + ტრანსაქციის საფასური - საკომისიო: + Send to multiple recipients at once გაგზავნა რამდენიმე რეციპიენტთან ერთდროულად @@ -1507,6 +1515,10 @@ The amount exceeds your balance. თანხა აღემატება თქვენს ბალანსს + + The total exceeds your balance when the %1 transaction fee is included. + საკომისიო %1-ის დამატების შემდეგ თანხა აჭარბებს თქვენს ბალანსს + Transaction creation failed! შეცდომა ტრანსაქციის შექმნისას! @@ -2325,10 +2337,18 @@ Set maximum size of high-priority/low-fee transactions in bytes (default: %d) მაღალპრიორიტეტული/დაბალსაკომისიოიანი ტრანსაქციების მაქსიმალური ზომა ბაიტებში (ნაგულისხმევი: %d) + + Cannot resolve -whitebind address: '%s' + ვერ ხერხდება -whitebind მისამართის გარკვევა: '%s' + Information ინფორმაცია + + Invalid amount for -maxtxfee=<amount>: '%s' + დაუშვებელი მნიშვნელობა -pmaxtxfee<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' დაუშვებელი მნიშვნელობა -minrelaytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_kk_KZ.ts b/src/qt/locale/bitcoin_kk_KZ.ts index 4de8f1b57e300..cfa19d13f01e1 100644 --- a/src/qt/locale/bitcoin_kk_KZ.ts +++ b/src/qt/locale/bitcoin_kk_KZ.ts @@ -230,6 +230,10 @@ EditAddressDialog + + &Label + таңба + &Address Адрес @@ -253,6 +257,10 @@ OptionsDialog + + W&allet + Әмиян + OverviewPage @@ -275,9 +283,17 @@ RPCConsole + + &Information + Информация + ReceiveCoinsDialog + + &Amount: + Саны + ReceiveRequestDialog @@ -342,6 +358,10 @@ SendCoinsEntry + + A&mount: + Саны + ShutdownWindow diff --git a/src/qt/locale/bitcoin_ko_KR.ts b/src/qt/locale/bitcoin_ko_KR.ts index 81677b4732153..ce48ce249fffc 100644 --- a/src/qt/locale/bitcoin_ko_KR.ts +++ b/src/qt/locale/bitcoin_ko_KR.ts @@ -810,7 +810,7 @@ command-line options 명령줄 옵션 - + Intro @@ -1175,6 +1175,14 @@ Enter a Bitcoin address (e.g. %1) 비트코인 주소를 입력하기 (예. %1) + + %1 h + %1 시간 + + + %1 m + %1 분 + %1 s %1 초 @@ -1333,6 +1341,22 @@ Type <b>help</b> for an overview of available commands. 사용할 수 있는 명령을 둘러보려면 <b>help</b>를 입력하십시오. + + %1 B + %1 바이트 + + + %1 KB + %1 킬로바이트 + + + %1 MB + %1 메가바이트 + + + %1 GB + %1 기가바이트 + ReceiveCoinsDialog @@ -2200,6 +2224,10 @@ Export Transaction History 거래 기록 내보내기 + + Watch-only + 모니터링 지갑 + Exporting Failed 내보내기 실패 @@ -2391,6 +2419,10 @@ Error initializing block database 블록 데이터베이스를 초기화하는데 오류 + + Error initializing wallet database environment %s! + 지갑 데이터베이스 환경 초기화하는데 오류 %s + Error loading block database 블록 데이터베이스를 불러오는데 오류 @@ -2467,10 +2499,18 @@ Set maximum size of high-priority/low-fee transactions in bytes (default: %d) 최대 크기를 최우선으로 설정 / 바이트당 최소 수수료로 거래(기본값: %d) + + Cannot resolve -whitebind address: '%s' + -whitebind 주소를 확인할 수 없습니다: '%s' + Information 정보 + + Invalid amount for -maxtxfee=<amount>: '%s' + -maxtxfee=<amount>에 대한 양이 잘못되었습니다: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' 노드로 전달하기 위한 최저 거래 수수료가 부족합니다. - minrelaytxfee=<amount>: '%s' - diff --git a/src/qt/locale/bitcoin_ky.ts b/src/qt/locale/bitcoin_ky.ts index 495f11b1f4489..51efd519c3821 100644 --- a/src/qt/locale/bitcoin_ky.ts +++ b/src/qt/locale/bitcoin_ky.ts @@ -125,6 +125,10 @@ &Network &Тармак + + W&allet + Капчык + &Port: &Порт: @@ -175,6 +179,10 @@ General Жалпы + + Network + &Тармак + Name Аты @@ -194,6 +202,10 @@ ReceiveCoinsDialog + + &Message: + Билдирүү: + ReceiveRequestDialog diff --git a/src/qt/locale/bitcoin_la.ts b/src/qt/locale/bitcoin_la.ts index f775002050902..e3dcd505feaf9 100644 --- a/src/qt/locale/bitcoin_la.ts +++ b/src/qt/locale/bitcoin_la.ts @@ -305,6 +305,10 @@ Bitcoin Core Bitcoin Nucleus + + &Command-line options + Optiones mandati initiantis + No block source available... Nulla fons frustorum absens... @@ -476,7 +480,7 @@ command-line options Optiones mandati intiantis - + Intro @@ -513,6 +517,10 @@ &Network &Rete + + W&allet + Cassidile + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Aperi per se portam clientis Bitcoin in itineratore. Hoc tantum effectivum est si itineratrum tuum supportat UPnP et id activum est. @@ -655,6 +663,10 @@ &Information &Informatio + + Debug window + Fenestra Debug + Using OpenSSL version Utens OpenSSL versione @@ -714,10 +726,18 @@ ReceiveCoinsDialog + + &Amount: + Quantitas: + &Label: &Titulus: + + &Message: + Nuntius: + Copy label Copia titulum @@ -729,6 +749,10 @@ ReceiveRequestDialog + + Copy &Address + &Copia Inscriptionem + Address Inscriptio @@ -783,10 +807,18 @@ Send Coins Mitte Nummos + + Insufficient funds! + Inopia nummorum + Amount: Quantitas: + + Transaction Fee: + Transactionis merces: + Send to multiple recipients at once Mitte pluribus accipientibus simul @@ -870,6 +902,10 @@ Message: Nuntius: + + Pay To: + Pensa Ad: + ShutdownWindow @@ -1461,10 +1497,18 @@ Verifying wallet... Verificante cassidilem... + + Cannot resolve -whitebind address: '%s' + Non posse resolvere -whitebind inscriptionem: '%s' + Information Informatio + + Invalid amount for -maxtxfee=<amount>: '%s' + Quantitas non valida pro -maxtxfee=<amount>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Quantitas non valida pro -minrelaytxfee=<amount>: '%s' diff --git a/src/qt/locale/bitcoin_lt.ts b/src/qt/locale/bitcoin_lt.ts index c125d1b72bec7..b98976dfeaec2 100644 --- a/src/qt/locale/bitcoin_lt.ts +++ b/src/qt/locale/bitcoin_lt.ts @@ -190,7 +190,11 @@ BanTableModel - + + Banned Until + Užblokuotas iki + + BitcoinGUI @@ -357,6 +361,10 @@ &About Bitcoin Core &Apie Bitcoin Core + + &Command-line options + Komandinės eilutės parametrai + Error Klaida @@ -551,7 +559,11 @@ (no label) (nėra žymės) - + + (change) + (Graža) + + EditAddressDialog @@ -632,7 +644,7 @@ command-line options komandinės eilutės parametrai - + Intro @@ -665,10 +677,26 @@ &Main &Pagrindinės + + MB + MB + + + IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) + Proxy IP adresas (Pvz. IPv4: 127.0.0.1 / IPv6: ::1) + + + &Reset Options + &Atstatyti Parinktis + &Network &Tinklas + + W&allet + Piniginė + Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. Automatiškai atidaryti Bitcoin kliento prievadą maršrutizatoriuje. Tai veikia tik tada, kai jūsų maršrutizatorius palaiko UPnP ir ji įjungta. @@ -689,6 +717,18 @@ Port of the proxy (e.g. 9050) Tarpinio serverio preivadas (pvz, 9050) + + IPv4 + IPv4 + + + IPv6 + IPv6 + + + Tor + Tor + &Window &Langas @@ -741,6 +781,14 @@ Confirm options reset Patvirtinti nustatymų atstatymą + + Client restart required to activate changes. + Kliento perkrovimas reikalingas nustatymų aktyvavimui + + + This change would require a client restart. + Šis pakeitimas reikalautų kliento perkrovimo + The supplied proxy address is invalid. Nurodytas tarpinio serverio adresas negalioja. @@ -756,6 +804,10 @@ Available: Galimi: + + Your current spendable balance + Jūsų dabartinis išleidžiamas balansas + Pending: Laukiantys: @@ -779,10 +831,18 @@ URI handling URI apdorojimas + + Invalid payment address %1 + Neteisingas mokėjimo adresas %1 + Payment request rejected Mokėjimo siuntimas atmestas + + Payment request expired. + Mokėjimo siuntimas pasibaigė + Network request error Tinklo užklausos klaida @@ -812,11 +872,19 @@ QRImageWidget + + &Copy Image + Kopijuoti nuotrauką + Save QR Code Įrašyti QR kodą - + + PNG Image (*.png) + PNG paveikslėlis (*.png) + + RPCConsole @@ -835,6 +903,10 @@ &Information &Informacija + + Debug window + Derinimo langas + Using OpenSSL version Naudojama OpenSSL versija @@ -847,6 +919,10 @@ Network Tinklas + + Name + Pavadinimas + Number of connections Prisijungimų kiekis @@ -883,6 +959,10 @@ &Console &Konsolė + + &Clear + Išvalyti + Totals Viso: @@ -919,13 +999,29 @@ never Niekada + + Yes + Taip + + + No + Ne + ReceiveCoinsDialog + + &Amount: + Suma: + &Label: Ž&ymė: + + &Message: + Žinutė: + Clear Išvalyti @@ -945,6 +1041,10 @@ QR Code QR kodas + + Copy &Address + &Kopijuoti adresą + Payment information Mokėjimo informacija @@ -999,6 +1099,10 @@ Send Coins Siųsti monetas + + Insufficient funds! + Nepakanka lėšų + Quantity: Kiekis: @@ -1027,6 +1131,10 @@ Change: Graža: + + Transaction Fee: + Sandorio mokestis: + Send to multiple recipients at once Siųsti keliems gavėjams vienu metu @@ -1091,6 +1199,10 @@ The total exceeds your balance when the %1 transaction fee is included. Jei pridedame sandorio mokestį %1 bendra suma viršija jūsų balansą. + + Payment request expired. + Mokėjimo siuntimas pasibaigė + (no label) (nėra žymės) @@ -1130,6 +1242,10 @@ Message: Žinutė: + + Pay To: + Mokėti gavėjui: + ShutdownWindow @@ -1176,6 +1292,10 @@ Verify the message to ensure it was signed with the specified Bitcoin address Patikrinkite žinutę, jog įsitikintumėte, kad ją pasirašė nurodytas Bitcoin adresas + + Verify &Message + &Patikrinti žinutę + Click "Sign Message" to generate signature Spragtelėkite "Registruotis žinutę" tam, kad gauti parašą @@ -1629,6 +1749,18 @@ Information Informacija + + Invalid amount for -maxtxfee=<amount>: '%s' + Neteisinga suma -maxtxfee=<amount>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + Neteisinga suma -minrelaytxfee=<amount>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Neteisinga suma -mintxfee=<amount>: '%s' + Send trace/debug info to console instead of debug.log file Siųsti atsekimo/derinimo info į konsolę vietoj debug.log failo diff --git a/src/qt/locale/bitcoin_lv_LV.ts b/src/qt/locale/bitcoin_lv_LV.ts index 2d3eab3394aa3..e01d4c812c5fa 100644 --- a/src/qt/locale/bitcoin_lv_LV.ts +++ b/src/qt/locale/bitcoin_lv_LV.ts @@ -720,6 +720,10 @@ About Bitcoin Core Par Bitcoin Core + + Command-line options + Komandrindas iespējas + Usage: Lietojums: @@ -728,7 +732,7 @@ command-line options komandrindas izvēles - + Intro @@ -1375,6 +1379,10 @@ Custom change address Pielāgota atlikuma adrese + + Transaction Fee: + Transakcijas maksa: + Send to multiple recipients at once Sūtīt vairākiem saņēmējiem uzreiz @@ -2157,10 +2165,26 @@ Wallet options: Maciņa iespējas: + + Cannot resolve -whitebind address: '%s' + Nevar atrisināt -whitebind adresi: '%s' + Information Informācija + + Invalid amount for -maxtxfee=<amount>: '%s' + Nederīgs daudzums priekš -maxtxfee=<amount>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + Nederīgs daudzums priekš -minrelaytxfee=<amount>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Nederīgs daudzums priekš -mintxfee=<amount>: '%s' + RPC server options: RPC servera iestatījumi: diff --git a/src/qt/locale/bitcoin_mk_MK.ts b/src/qt/locale/bitcoin_mk_MK.ts index 269b06f83a56b..b7797063b2856 100644 --- a/src/qt/locale/bitcoin_mk_MK.ts +++ b/src/qt/locale/bitcoin_mk_MK.ts @@ -912,10 +912,18 @@ SendCoinsEntry + + A&mount: + Сума: + &Label: &Етикета: + + Message: + Порака: + ShutdownWindow @@ -1015,6 +1023,10 @@ bitcoin-core + + Options: + Опции: + Warning Предупредување diff --git a/src/qt/locale/bitcoin_mn.ts b/src/qt/locale/bitcoin_mn.ts index d1a59762242b2..b790010066c29 100644 --- a/src/qt/locale/bitcoin_mn.ts +++ b/src/qt/locale/bitcoin_mn.ts @@ -233,6 +233,10 @@ &Change Passphrase... &Нууц Үгийг Солих... + + &Receiving addresses... + Хүлээн авах хаяг + Change the passphrase used for wallet encryption Түрүйвчийг цоожлох нууц үгийг солих @@ -269,6 +273,10 @@ Error Алдаа + + Information + Мэдээллэл + Up to date Шинэчлэгдсэн @@ -421,6 +429,14 @@ IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1) проксигийн IP хаяг (жишээ нь: IPv4: 127.0.0.1 / IPv6: ::1) + + &Network + Сүлжээ + + + W&allet + Түрүйвч + Client restart required to activate changes. Ѳѳрчлѳлтүүдийг идэвхижүүлхийн тулд клиентийг ахин эхлүүлэх шаардлагтай @@ -522,10 +538,18 @@ ReceiveCoinsDialog + + &Amount: + Хэмжээ: + &Label: &Шошго: + + &Message: + Зурвас: + Show Харуул @@ -553,6 +577,10 @@ ReceiveRequestDialog + + Copy &Address + Хаягийг &Хуулбарлах + Address Хаяг @@ -714,6 +742,10 @@ Message: Зурвас: + + Pay To: + Тѳлѳх хаяг: + ShutdownWindow @@ -1033,6 +1065,10 @@ Wallet options: Түрүйвчийн сонголтууд: + + Information + Мэдээллэл + Loading addresses... Хаягуудыг ачааллаж байна... diff --git a/src/qt/locale/bitcoin_ms_MY.ts b/src/qt/locale/bitcoin_ms_MY.ts index 8f6676e4845b3..df98dd839646c 100644 --- a/src/qt/locale/bitcoin_ms_MY.ts +++ b/src/qt/locale/bitcoin_ms_MY.ts @@ -121,6 +121,10 @@ ReceiveRequestDialog + + Copy &Address + &Salin Alamat + Address Alamat diff --git a/src/qt/locale/bitcoin_nb.ts b/src/qt/locale/bitcoin_nb.ts index 554ac21a022dd..9236ac86fe12d 100644 --- a/src/qt/locale/bitcoin_nb.ts +++ b/src/qt/locale/bitcoin_nb.ts @@ -882,6 +882,34 @@ command-line options kommandolinjevalg + + UI Options: + Grensesnittvalg: + + + Choose data directory on startup (default: %u) + Velg datakatalog for oppstart (default: %u) + + + Set language, for example "de_DE" (default: system locale) + Sett språk, for eksempel "nb_NO" (default: system-«locale») + + + Start minimized + Begynn minimert + + + Set SSL root certificates for payment request (default: -system-) + Sett SSL-rootsertifikat for betalingshenvendelser (default: -system-) + + + Show splash screen on startup (default: %u) + Vis velkomstbilde ved oppstart (default: %u) + + + Reset all settings changes made over the GUI + Nullstill alle oppsettendringer gjort via det grafiske grensesnittet + Intro @@ -1477,6 +1505,18 @@ Current number of blocks Nåværende antall blokker + + Memory Pool + Minnepool + + + Current number of transactions + Nåværende antall transaksjoner + + + Memory usage + Minnebruk + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Åpne Bitcoin Core sin loggfil for feilsøk fra gjeldende datamappe. Dette kan ta noen sekunder for store loggfiler. @@ -2919,6 +2959,10 @@ Error: A fatal internal error occurred, see debug.log for details Feil: En fatal intern feil oppstod, se debug.log for detaljer + + Fee (in %s/kB) to add to transactions you send (default: %s) + Gebyr (i %s/kB) for å legge til i transaksjoner du sender (standardverdi: %s) + Pruning blockstore... Beskjærer blokklageret... @@ -3479,6 +3523,10 @@ Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Feil ved lesing av wallet.dat! Alle nøkler lest riktig, men transaksjonsdataene eller oppføringer i adresseboken mangler kanskje eller er feil. + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Gebyrer (i %s/Kb) mindre enn dette anses som null gebyr for laging av transaksjoner (standardverdi: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Hvor grundig blokkverifiseringen til -checkblocks er (0-4, standardverdi: %u) @@ -3495,6 +3543,10 @@ Output debugging information (default: %u, supplying <category> is optional) Ta ut feilsøkingsinformasjon (standardverdi: %u, bruk av <category> er valgfritt) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Støtte filtrering av blokker og transaksjoner med bloomfiltre (standardverdi: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. Total lengde av nettverks-versionstreng (%i) er over maks lengde (%i). Reduser tallet eller størrelsen av uacomments. @@ -3511,6 +3563,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Bruk separate SOCKS5 proxyer for å nå noder via Tor skjulte tjenester (standardverdi: %s) + + 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. This option can be specified multiple times + Brukernavn og hashet passord for JSON-RPC tilkoblinger. Feltet <userpw> kommer i formatet: <USERNAME>:<SALT>$<HASH>. Et Python-skript er inkludert i share/rpcuser. Dette alternativet kan angis flere ganger + (default: %s) (standardverdi: %s) diff --git a/src/qt/locale/bitcoin_nl.ts b/src/qt/locale/bitcoin_nl.ts index be2ec9ac4f8e7..8457a9ab50265 100644 --- a/src/qt/locale/bitcoin_nl.ts +++ b/src/qt/locale/bitcoin_nl.ts @@ -59,7 +59,7 @@ Sending addresses - Verstuur adressen + Verstuuradressen Receiving addresses @@ -67,11 +67,11 @@ These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins. - Dit zijn uw Bitcoinadressen om betalingen mee te verzenden. Controleer altijd het bedrag en het ontvang adres voordat u uw bitcoins verzendt. + Dit zijn uw Bitcoinadressen om betalingen mee te doen. Controleer altijd het bedrag en het ontvang adres voordat u uw bitcoins verstuurt. These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - Dit zijn uw Bitcoin-adressen waarmee u kunt betalen. We raden u aan om een nieuw ontvangstadres voor elke transactie te gebruiken. + Dit zijn uw Bitcoinadressen waarmee u kunt betalen. We raden u aan om een nieuw ontvangstadres voor elke transactie te gebruiken. Copy &Label @@ -157,7 +157,7 @@ Confirm wallet encryption - Bevestig versleuteling van de portemonnee + Bevestig versleuteling van uw portemonnee Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>! @@ -177,7 +177,7 @@ Warning: The Caps Lock key is on! - Waarschuwing: De Caps-Lock-toets staat aan! + Waarschuwing: De Caps Locktoets staat aan! Wallet encrypted @@ -222,6 +222,10 @@ BanTableModel + + IP/Netmask + IP/Netmasker + Banned Until Geband tot @@ -255,11 +259,11 @@ Browse transaction history - Blader door transactieverleden + Blader door transactiegescheidenis E&xit - &Afsluiten + A&fsluiten Quit application @@ -275,7 +279,7 @@ &Options... - O&pties... + &Opties... &Encrypt Wallet... @@ -291,11 +295,11 @@ &Sending addresses... - V&erstuur adressen... + &Verstuuradressen... &Receiving addresses... - O&ntvang adressen... + &Ontvang adressen... Open &URI... @@ -303,7 +307,7 @@ Bitcoin Core client - Bitcoin Kern applicatie + Bitcoin Coreapplicatie Importing blocks from disk... @@ -347,7 +351,7 @@ &Send - &Versturen + &Verstuur &Receive @@ -355,7 +359,7 @@ Show information about Bitcoin Core - Toon informatie over bitcoin kern + Toon informatie over Bitcoin Core &Show / Hide @@ -395,11 +399,11 @@ Bitcoin Core - Bitcoin Kern + Bitcoin Core Request payments (generates QR codes and bitcoin: URIs) - Vraag betaling aan (genereert QR codes en bitcoin: URIs) + Vraag betaling aan (genereert QR-codes en bitcoin: URI's) &About Bitcoin Core @@ -411,7 +415,7 @@ Show the list of used sending addresses and labels - Toon de lijst met gebruikt verzend adressen en labels + Toon de lijst met gebruikte verstuuradressen en -labels Show the list of used receiving addresses and labels @@ -423,15 +427,15 @@ &Command-line options - &Commandoregel-opties + &Opdrachytregelopties Show the Bitcoin Core help message to get a list with possible Bitcoin command-line options - Toon het Bitcoin Core hulpbericht om een lijst te krijgen met mogelijke Bitcoin commandoregelopties + Toon het Bitcoin Core hulpbericht om een lijst te krijgen met mogelijke Bitcoinopdrachtregelopties %n active connection(s) to Bitcoin network - %n actieve connectie naar Bitcoin netwerk%n actieve connecties naar Bitcoin netwerk + %n actieve verbinding met Bitcoinnetwerk%n actieve verbindingen met Bitcoinnetwerk No block source available... @@ -439,11 +443,11 @@ Processed %n block(s) of transaction history. - %n blok aan transactie geschiedenis verwerkt.%n blokken aan transactie geschiedenis verwerkt. + %n blok aan transactiegeschiedenis verwerkt.%n blokken aan transactiegeschiedenis verwerkt. %n hour(s) - %n uur%n uur + %n uur%n uren %n day(s) @@ -459,7 +463,7 @@ %n year(s) - %n jaar%n jaar + %n jaar%n jaren %1 behind @@ -525,7 +529,7 @@ Sent transaction - Verzonden transactie + Verstuurde transactie Incoming transaction @@ -571,7 +575,7 @@ Fee: - Vergoeding: + Transactiekosten: Dust: @@ -579,7 +583,7 @@ After Fee: - Na vergoeding: + Naheffing: Change: @@ -655,11 +659,11 @@ Copy fee - Kopieer vergoeding + Kopieerkosten Copy after fee - Kopieer na vergoeding + Kopieernaheffing Copy bytes @@ -747,15 +751,15 @@ This means a fee of at least %1 per kB is required. - Dit betekent dat een vergoeding van minimaal %1 per kB nodig is. + Dit betekent dat kosten van minimaal %1 per kB aan verbonden zijn. Can vary +/- 1 byte per input. - Kan +/- byte per invoer variëren. + Kan +/- 1 byte per invoer variëren. Transactions with higher priority are more likely to get included into a block. - Transacties met een hogere prioriteit zullen eerder in een block gezet worden. + Transacties met een hogere prioriteit zullen eerder in een blok gezet worden. (no label) @@ -786,7 +790,7 @@ The address associated with this address list entry. This can only be modified for sending addresses. - Het adres dat bij dit adres item hoort. Dit kan alleen bewerkt worden voor verstuur adressen. + Het adres dat bij dit adresitem hoort. Dit kan alleen bewerkt worden voor verstuuradressen. &Address @@ -798,7 +802,7 @@ New sending address - Nieuw adres om naar te verzenden + Nieuw adres om naar te versturen Edit receiving address @@ -806,7 +810,7 @@ Edit sending address - Bewerk adres om naar te verzenden + Bewerk adres om naar te versturen The entered address "%1" is already in the address book. @@ -841,7 +845,7 @@ Path already exists, and is not a directory. - Communicatiepad bestaat al, en is geen folder. + Communicatiepad bestaat al, en is geen map. Cannot create data directory here. @@ -852,7 +856,7 @@ HelpMessageDialog Bitcoin Core - Bitcoin Kern + Bitcoin Core version @@ -868,7 +872,7 @@ Command-line options - Commandoregel-opties + Opdrachtregelopties Usage: @@ -876,7 +880,35 @@ command-line options - commandoregel-opties + opdrachtregelopties + + + UI Options: + UI-opties: + + + Choose data directory on startup (default: %u) + Kies gegevensmap bij opstarten (standaard: %u) + + + Set language, for example "de_DE" (default: system locale) + Stel taal in, bijvoorbeeld "nl_NL" (standaard: systeemlocale) + + + Start minimized + Geminimaliseerd starten + + + Set SSL root certificates for payment request (default: -system-) + Zet SSL-rootcertificaat voor betalingsverzoeken (standaard: -systeem-) + + + Show splash screen on startup (default: %u) + Toon opstartscherm bij opstarten (standaard: %u) + + + Reset all settings changes made over the GUI + Reset alle wijzigingen aan instellingen gedaan met de GUI @@ -895,7 +927,7 @@ Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - Bitcoin Core zal een kopie van de Bitcoin blokketen downloaden en opslaan. Tenminste %1 GB aan data wordt opgeslagen in deze map en het zal groeien in de tijd. De portemonnee wordt ook in deze map opgeslagen. + Bitcoin Core zal een kopie van de Bitcoinblokketen downloaden en opslaan. Tenminste %1 GB aan data wordt opgeslagen in deze map en het zal groeien in de tijd. De portemonnee wordt ook in deze map opgeslagen. Use the default data directory @@ -907,7 +939,7 @@ Bitcoin Core - Bitcoin Kern + Bitcoin Core Error: Specified data directory "%1" cannot be created. @@ -919,7 +951,7 @@ %n GB of free space available - %n GB aan vrije oplsagruimte beschikbaar%n GB aan vrije oplsagruimte beschikbaar + %n GB aan vrije opslagruimte beschikbaar%n GB aan vrije opslagruimte beschikbaar (of %n GB needed) @@ -961,7 +993,7 @@ Size of &database cache - Grootte van de &database cache + Grootte van de &databasecache MB @@ -993,7 +1025,7 @@ 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 |. - Derde partijen URL's (bijvoorbeeld block explorer) dat in de transacties tab verschijnen als contextmenu elementen. %s in de URL is vervangen door transactie hash. Verscheidene URL's zijn gescheiden door een verticale streep |. + URL's van derden (bijvoorbeeld block explorer) 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 |. Third party transaction URLs @@ -1001,7 +1033,7 @@ Active command-line options that override above options: - Actieve commandoregelopties die bovenstaande opties overschrijven: + Actieve opdrachtregelopties die bovenstaande opties overschrijven: Reset all client options to default. @@ -1017,11 +1049,11 @@ Automatically start Bitcoin Core after logging in to the system. - Bitcoin Kern automatisch starten bij inloggen. + Bitcoin Core automatisch starten bij inloggen. &Start Bitcoin Core on system login - &Start Bitcoin Kern tijdens login. + &Start Bitcoin Core tijdens login. (0 = auto, <0 = leave that many cores free) @@ -1049,7 +1081,7 @@ Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled. - Open de Bitcoin-poort automatisch op de router. Dit werkt alleen als de router UPnP ondersteunt en het aanstaat. + Open de Bitcoinpoort automatisch op de router. Dit werkt alleen als de router UPnP ondersteunt en het aanstaat. Map port using &UPnP @@ -1057,7 +1089,7 @@ Connect to the Bitcoin network through a SOCKS5 proxy. - Verbind met het Bitcoin netwerk via een SOCKS5 proxy. + Verbind met het Bitcoinnetwerk via een SOCKS5 proxy. &Connect through SOCKS5 proxy (default proxy): @@ -1075,6 +1107,14 @@ Port of the proxy (e.g. 9050) Poort van de proxy (bijv. 9050) + + Used for reaching peers via: + Gebruikt om peers te bereiken via: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Vertoningen, als de opgegeven standaard SOCKS5-proxy is gebruikt om peers te benaderen via dit type netwerk. + IPv4 IPv4 @@ -1087,13 +1127,21 @@ Tor Tor + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + Maak verbinding met Bitcoinnetwerk door een aparte SOCKS5-proxy voor verborgen diensten van Tor. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Gebruikt aparte SOCKS5-proxy om peers te bereiken via verborgen diensten van Tor: + &Window &Scherm Show only a tray icon after minimizing the window. - Laat alleen een systeemvak-icoon zien wanneer het venster geminimaliseerd is + Laat alleen een systeemvakicoon zien wanneer het venster geminimaliseerd is &Minimize to the tray instead of the taskbar @@ -1101,7 +1149,7 @@ M&inimize on close - Minimaliseer bij sluiten van het &venster + M&inimaliseer bij sluiten van het venster &Display @@ -1117,7 +1165,7 @@ Choose the default subdivision unit to show in the interface and when sending coins. - Kies de standaard onderverdelingseenheid om weer te geven in uw programma, en voor het versturen van munten + Kies de standaardonderverdelingseenheid om weer te geven in uw programma, en voor het versturen van munten Whether to show coin control features or not. @@ -1129,7 +1177,7 @@ &Cancel - Ann&uleren + &Annuleren default @@ -1275,7 +1323,7 @@ URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters. - URI kan niet verwerkt worden! Dit kan het gevolg zijn van een ongeldig Bitcoin adres of misvormde URI parameters. + URI kan niet verwerkt worden! Dit kan het gevolg zijn van een ongeldig Bitcoinadres of misvormde URI-parameters. Payment request file handling @@ -1283,7 +1331,7 @@ Payment request file cannot be read! This can be caused by an invalid payment request file. - Betalingsverzoek-bestand kan niet gelezen of verwerkt worden! Dit kan veroorzaakt worden door een ongeldig betalingsverzoek-bestand. + Betalingsverzoekbestand kan niet gelezen of verwerkt worden! Dit kan veroorzaakt worden door een ongeldig betalingsverzoek-bestand. Payment request expired. @@ -1334,7 +1382,7 @@ Node/Service - Node/Service + Node/Dienst Ping Time @@ -1349,11 +1397,11 @@ Enter a Bitcoin address (e.g. %1) - Voer een Bitcoin-adres in (bijv. %1) + Voer een Bitcoinadres in (bijv. %1) %1 d - %1d + %1 d %1 h @@ -1365,7 +1413,7 @@ %1 s - %1s + %1 s None @@ -1457,9 +1505,21 @@ Current number of blocks Huidig aantal blokken + + Memory Pool + Geheugenpoel + + + Current number of transactions + Huidig aantal transacties + + + Memory usage + Geheugengebruik + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. - Open het Bitcoin Core debug logbestand van de huidige gegevens directory. Dit kan enkele seconden duren voor grote logbestanden. + Open het Bitcoin Core debuglogbestand van de huidige gegevensmap. Dit kan enkele seconden duren voor grote logbestanden. Received @@ -1473,10 +1533,18 @@ &Peers &Peers + + Banned peers + Gebande peers + Select a peer to view detailed information. Selecteer een peer om gedetailleerde informatie te bekijken. + + Whitelisted + Toegestaan + Direction Directie @@ -1485,6 +1553,10 @@ Version Versie + + Starting Block + Start Blok + Synced Headers Gesynchroniseerde headers @@ -1499,7 +1571,7 @@ Services - Services + Diensten Ban Score @@ -1525,6 +1597,14 @@ The duration of a currently outstanding ping. De tijdsduur van een op het moment openstaande ping. + + Ping Wait + Pingwachttijd + + + Time Offset + Tijdcompensatie + Last block time Tijd laatste blok @@ -1563,12 +1643,20 @@ Debug log file - Debug-logbestand + Debuglogbestand Clear console Maak console leeg + + &Disconnect Node + &Verbreek Verbinding Node + + + Ban Node for + Ban Node voor + 1 &hour 1 &uur @@ -1585,6 +1673,10 @@ 1 &year 1 &jaar + + &Unban Node + &Maak Ban Ongedaan voor Node + Welcome to the Bitcoin Core RPC console. Welkom op de Bitcoin Core RPC console. @@ -1595,7 +1687,7 @@ Type <b>help</b> for an overview of available commands. - Typ <b>help</b> voor een overzicht van de beschikbare commando's. + Typ <b>help</b> voor een overzicht van de beschikbare opdrachten. %1 B @@ -1613,6 +1705,10 @@ %1 GB %1 Gb + + (node id: %1) + (node id: %1) + via %1 via %1 @@ -1666,7 +1762,7 @@ 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. - Een optioneel bericht om bij te voegen aan het betalingsverzoek, dewelke zal getoond worden wanneer het verzoek is geopend. Opermerking: Het bericht zal niet worden verzonden met de betaling over het Bitcoin netwerk. + 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. An optional label to associate with the new receiving address. @@ -1815,7 +1911,7 @@ SendCoinsDialog Send Coins - Verstuur munten + Verstuurde munten Coin Control Features @@ -1851,11 +1947,11 @@ Fee: - Vergoeding: + Kosten: After Fee: - Na vergoeding: + Naheffing: Change: @@ -1863,7 +1959,7 @@ If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address. - Als dit is geactiveerd, maar het wisselgeldadres is leeg of ongeldig, dan wordt het wisselgeld verzonden naar een nieuw gegenereerd adres. + Als dit is geactiveerd, maar het wisselgeldadres is leeg of ongeldig, dan wordt het wisselgeld verstuurd naar een nieuw gegenereerd adres. Custom change address @@ -1879,7 +1975,7 @@ collapse fee-settings - Transactiekosteninstellingen verbergen + verberg kosteninstellingen per kilobyte @@ -1915,7 +2011,7 @@ (Smart fee not initialized yet. This usually takes a few blocks...) - (Slimme vergoeding is nog niet geïnitialiseerd. Dit duurt meestal een paar blokken...) + (Slimme transactiekosten is nog niet geïnitialiseerd. Dit duurt meestal een paar blokken...) Confirmation time: @@ -1931,7 +2027,7 @@ Send as zero-fee transaction if possible - Verstuur als transactie zonder verzendkosten indien mogelijk + Indien mogelijk, verstuur zonder transactiekosten (confirmation may take longer) @@ -1939,7 +2035,7 @@ Send to multiple recipients at once - Verstuur aan verschillende ontvangers ineens + Verstuur in een keer aan verschillende ontvangers Add &Recipient @@ -1967,7 +2063,7 @@ S&end - &Verstuur + V&erstuur Confirm send coins @@ -1987,11 +2083,11 @@ Copy fee - Kopieer vergoeding + Kopieerkosten Copy after fee - Kopieer na vergoeding + Kopieernaheffing Copy bytes @@ -2033,10 +2129,22 @@ The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. De transactie was afgewezen. Dit kan gebeuren als u eerder uitgegeven munten opnieuw wilt versturen, zoals wanneer u een kopie van uw wallet.dat heeft gebruikt en in de kopie deze munten zijn gemarkeerd als uitgegeven, maar in de huidige nog niet. + + A fee higher than %1 is considered an absurdly high fee. + Transactiekosten van meer dan %1 wordt beschouwd als een absurd hoge transactiekosten. + Payment request expired. Betalingsverzoek verlopen. + + Pay only the required fee of %1 + Betaal alleen de verplichte transactiekosten van %1 + + + Estimated to begin confirmation within %n block(s). + Schatting is dat bevestiging begint over %n blok.Schatting is dat bevestiging begint over %n blokken. + The recipient address is not valid. Please recheck. Het adres van de ontvanger is niet geldig. Gelieve opnieuw te controleren.. @@ -2047,7 +2155,7 @@ Warning: Invalid Bitcoin address - Waarschuwing: Ongeldig Bitcoin adres + Waarschuwing: Ongeldig Bitcoinadres (no label) @@ -2063,7 +2171,7 @@ Are you sure you want to send? - Weet u zeker dat u wilt verzenden? + Weet u zeker dat u wilt versturen? added as transaction fee @@ -2074,7 +2182,7 @@ SendCoinsEntry A&mount: - Bedra&g: + B&edrag: Pay &To: @@ -2098,7 +2206,7 @@ The Bitcoin address to send the payment to - Het Bitcoin adres om betaling aan te voldoen + Het Bitcoinadres om betaling aan te versturen Alt+A @@ -2118,11 +2226,11 @@ 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. - De vergoeding zal worden afgetrokken van het bedrag dat verzonden wordt. De ontvangers zullen minder bitcoins ontvangen dan ingevoerd is in het hoeveelheids veld. Als er meerdere ontvangers geselecteerd zijn, dan wordt de vergoeding gelijk verdeeld. + 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. S&ubtract fee from amount - Trek de vergoeding af van het bedrag. + Trek de transactiekosten a&f van het bedrag. Message: @@ -2142,7 +2250,7 @@ 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. - Een bericht dat werd toegevoegd aan de bitcoin: URI dewelke wordt opgeslagen met de transactie ter referentie. Opmerking: Dit bericht zal niet worden verzonden over het Bitcoin netwerk. + 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. Pay To: @@ -2168,19 +2276,19 @@ SignVerifyMessageDialog Signatures - Sign / Verify a Message - Handtekeningen - Onderteken een bericht / Verifiëer een handtekening + Handtekeningen – Onderteken een bericht / Verifiëer een handtekening &Sign Message - O&nderteken Bericht + &Onderteken Bericht 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. - 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 phishing-aanvallen 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. + 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. The Bitcoin address to sign the message with - Het Bitcoin adres om bericht mee te ondertekenen + Het Bitcoinadres om bericht mee te ondertekenen Choose previously used address @@ -2236,7 +2344,7 @@ The Bitcoin address the message was signed with - Het Bitcoin adres waarmee het bericht ondertekend is + Het Bitcoinadres waarmee het bericht ondertekend is Verify the message to ensure it was signed with the specified Bitcoin address @@ -2307,11 +2415,11 @@ SplashScreen Bitcoin Core - Bitcoin Kern + Bitcoin Core The Bitcoin Core developers - De Bitcoin Core ontwikkelaars + De Bitcoin Core-ontwikkelaars [testnet] @@ -2441,7 +2549,7 @@ Debug information - Debug-informatie + Debuginformatie Transaction @@ -2499,7 +2607,7 @@ Immature (%1 confirmations, will be available after %2) - immatuur (%1 bevestigingen, zal beschikbaar zijn na %2) + Premature (%1 bevestigingen, zal beschikbaar zijn na %2) Open for %n more block(s) @@ -2551,7 +2659,7 @@ Sent to - Verzonden aan + Verstuurd aan Payment to yourself @@ -2585,6 +2693,10 @@ Whether or not a watch-only address is involved in this transaction. Of er een alleen-bekijken adres is betrokken bij deze transactie. + + User-defined intent/purpose of the transaction. + Door gebruiker gedefinieerde intentie/doel van de transactie + Amount removed from or added to balance. Bedrag verwijderd van of toegevoegd aan saldo @@ -2626,7 +2738,7 @@ Sent to - Verzonden aan + Verstuurd aan To yourself @@ -2666,7 +2778,7 @@ Copy raw transaction - Kopieer + Kopieer ruwe transactie Edit label @@ -2678,7 +2790,7 @@ Export Transaction History - Exporteer Transactieverleden + Exporteer Transactiegeschiedenis Watch-only @@ -2690,7 +2802,7 @@ There was an error trying to save the transaction history to %1. - Er is een fout opgetreden bij het opslaan van het transactieverleden naar %1. + Er is een fout opgetreden bij het opslaan van het transactiegeschiedenis naar %1. Exporting Successful @@ -2698,7 +2810,7 @@ The transaction history was successfully saved to %1. - Het transactieverleden was succesvol bewaard in %1. + Het transactiegeschiedenis was succesvol bewaard in %1. Comma separated file (*.csv) @@ -2755,7 +2867,7 @@ WalletModel Send Coins - Verstuur munten + Verstuur Munten @@ -2774,7 +2886,7 @@ Wallet Data (*.dat) - Portemonnee-data (*.dat) + Portemonneedata (*.dat) Backup Failed @@ -2782,7 +2894,7 @@ There was an error trying to save the wallet data to %1. - Er is een fout opgetreden bij het wegschrijven van de portemonnee-data naar %1. + Er is een fout opgetreden bij het wegschrijven van de portemonneedata naar %1. The wallet data was successfully saved to %1. @@ -2813,19 +2925,55 @@ Accept command line and JSON-RPC commands - Aanvaard commandoregel- en JSON-RPC-commando's + Aanvaard opdrachtregel- en JSON-RPC-opdrachten If <category> is not supplied or if <category> = 1, output all debugging information. - Als er geen <category> is opgegeven of als de <category> 1 is, laat dan alle debugging informatie zien. + Als er geen <categorie> is opgegeven of als de <categorie> 1 is, laat dan alle debugginginformatie zien. + + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Maximum totale transactiekosten (in %s) om te gebruiken voor een enkele portemonneetransactie; als dit te laag is ingesteld kan het grote transacties verhinderen (default: %s) + + + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Check a.u.b. of de datum en tijd van uw computer correct zijn! Als uw klok verkeerd staat zal Bitcoin Core niet correct werken. + + + Prune configured below the minimum of %d MiB. Please use a higher number. + Snoeien is geconfigureerd on het minimum van %d MiB. Gebruik a.u.b. een hoger aantal. + + + Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) + Snoei: laatste portemoneesynchronisatie gaat verder dan de gesnoeide data. U moet -reindex gebruiken (download opnieuw de gehele blokketen voor een weggesnoeide node) + + + Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files) + Beperk benodigde opslag door snoeien (verwijderen) van oude blokken. Deze modus is niet-compatibele met -txindex en -rescan. Waarschuwing: Terugzetten van deze instellingen vereist opnieuw downloaden van gehele de blokketen. (standaard:0 = uitzetten snoeimodus, >%u = doelgrootte in MiB voor blokbestanden) + + + Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again. + Herscannen is niet mogelijk in de snoeimodus. U moet -reindex gebruiken dat de hele blokketen opnieuw zal downloaden. Error: A fatal internal error occurred, see debug.log for details Fout: er is een fout opgetreden, zie debug.log voor details + + Fee (in %s/kB) to add to transactions you send (default: %s) + Transactiekosten (in %s/kB) toevoegen aan transacties die u doet (standaard: %s) + + + Pruning blockstore... + Snoei blokopslag... + Run in the background as a daemon and accept commands - Draai in de achtergrond als daemon en aanvaard commando's + Draai in de achtergrond als daemon en aanvaard opdrachten + + + Unable to start HTTP server. See debug log for details. + Niet mogelijk ok HTTP-server te starten. Zie debuglogboek voor details. Accept connections from outside (default: 1 if no -proxy or -connect) @@ -2837,11 +2985,11 @@ Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup - Verwijder alle transacties van de portemonnee en herstel alleen de delen van de blockchain door -rescan tijdens het opstarten + Verwijder alle transacties van de portemonnee en herstel alleen de delen van de blokketen door -rescan tijdens het opstarten Distributed under the MIT software license, see the accompanying file COPYING or <http://www.opensource.org/licenses/mit-license.php>. - Uitgegeven onder de MIT software licentie, zie het bijgevoegde bestand COPYING of <http://www.opensource.org/licenses/mit-license.php>. + Uitgegeven onder de MIT-softwarelicentie, zie het bijgevoegde bestand COPYING of <http://www.opensource.org/licenses/mit-license.php>. Execute command when a wallet transaction changes (%s in cmd is replaced by TxID) @@ -2849,16 +2997,28 @@ Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) - Kies het aantal script verificatie processen (%u tot %d, 0 = auto, <0 = laat dit aantal kernen vrij, standaard: %d) + Kies het aantal scriptverificatie processen (%u tot %d, 0 = auto, <0 = laat dit aantal kernen vrij, standaard: %d) + + + 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 + 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. This is a pre-release test build - use at your own risk - do not use for mining or merchant applications - Dit is een pre-release testversie - gebruik op eigen risico! Gebruik deze niet voor het delven van munten of handelsdoeleinden + Dit is een prerelease testversie – gebruik op eigen risico! Gebruik deze niet voor het delven van munten of handelsdoeleinden Unable to bind to %s on this computer. Bitcoin Core is probably already running. Niet in staat om %s te verbinden op deze computer. Bitcoin Core draait waarschijnlijk al. + + Use UPnP to map the listening port (default: 1 when listening and no -proxy) + Gebruik UPnP om de luisterende poort te mappen (standaard: 1 als er geluisterd worden en geen -proxy is meegegeven) + + + WARNING: abnormally high number of blocks generated, %d blocks received in the last %d hours (%d expected) + WAARSCHUWING: abnormaal hoog aantal blokken is gegenereerd, %d blokken ontvangen in de laatste %d uren (%d verwacht) + WARNING: check your network connection, %d blocks received in the last %d hours (%d expected) WAARSCHUWING: controleer uw netwerkverbinding, %d blokken ontvangen in de laatste %d uren (%d verwacht) @@ -2879,9 +3039,13 @@ Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. Goedgekeurde peers die verbinden van het ingegeven netmask of IP adres. Kan meerdere keren gespecificeerd worden. + + -maxmempool must be at least %d MB + -maxmempool moet tenminste %d MB zijn + <category> can be: - <category> kan zijn: + <categorie> kan zijn: Block creation options: @@ -2911,6 +3075,22 @@ Do you want to rebuild the block database now? Wilt u de blokkendatabase nu herbouwen? + + Enable publish hash block in <address> + Sta toe om hashblok te publiceren in <adres> + + + Enable publish hash transaction in <address> + Stat toe om hashtransactie te publiceren in <adres> + + + Enable publish raw block in <address> + Sta toe rauw blok te publiceren in <adres> + + + Enable publish raw transaction in <address> + Sta toe ruwe transacties te publiceren in <adres> + Error initializing block database Fout bij intialisatie blokkendatabase @@ -2941,12 +3121,16 @@ Incorrect or no genesis block found. Wrong datadir for network? - Incorrect of geen genesis-blok gevonden. Verkeerde datamap voor het netwerk? + Incorrect of geen genesisblok gevonden. Verkeerde datamap voor het netwerk? Invalid -onion address: '%s' Ongeldig -onion adres '%s' + + Keep the transaction memory pool below <n> megabytes (default: %u) + De transactiegeheugenpool moet onder de <n> megabytes blijven (standaard: %u) + Not enough file descriptors available. Niet genoeg file descriptors beschikbaar. @@ -2955,6 +3139,14 @@ Only connect to nodes in network <net> (ipv4, ipv6 or onion) Verbind alleen met nodes in netwerk <net> (ipv4, ipv6 of onion) + + Prune cannot be configured with a negative value. + Snoeien kan niet worden geconfigureerd met een negatieve waarde. + + + Prune mode is incompatible with -txindex. + Snoeimodus is niet-compatibel met -txindex + Set database cache size in megabytes (%d to %d, default: %d) Zet database cache grootte in megabytes (%d tot %d, standaard: %d) @@ -2967,10 +3159,26 @@ Specify wallet file (within data directory) Specificeer het portemonnee bestand (vanuit de gegevensmap) + + Unsupported argument -benchmark ignored, use -debug=bench. + Niet-ondersteund argument -benchmark genegeerd, gebruik -debug=bench. + + + Unsupported argument -debugnet ignored, use -debug=net. + Niet-ondersteund argument -debugnet genegeerd, gebruik -debug=net + + + Unsupported argument -tor found, use -onion. + Niet-ondersteund argument -tor gevonden, gebruik -onion. + Use UPnP to map the listening port (default: %u) Gebruik UPnP om de luisterende poort te mappen (standaard: %u) + + User Agent comment (%s) contains unsafe characters. + User Agentcommentaar (%s) bevat onveilige karakters. + Verifying blocks... Blokken aan het controleren... @@ -2993,7 +3201,7 @@ You need to rebuild the database using -reindex to change -txindex - Om -txindex te kunnen veranderen dient u de database opnieuw te bouwen met gebruik van -reindex. + Om -txindex te kunnen veranderen dient u de database herbouwen met gebruik van -reindex. 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 @@ -3015,30 +3223,41 @@ Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality) Creër nieuwe bestanden met standaard systeem bestandsrechten in plaats van umask 077 (alleen effectief met uitgeschakelde portemonnee functionaliteit) + + Discover own IP addresses (default: 1 when listening and no -externalip or -proxy) + Ontdek eigen IP-adressen (standaard: 1 voor luisteren en geen -externalip of -proxy) + Error: Listening for incoming connections failed (listen returned error %s) Fout: luisteren naar binnenkomende verbindingen mislukt (luisteren gaf foutmelding %s) Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) - Voer commando uit zodra een waarschuwing is ontvangen of wanneer we een erg lange fork detecteren (%s in commando wordt vervangen door bericht) + Voer opdracht uit zodra een waarschuwing is ontvangen of wanneer we een erg lange fork detecteren (%s in opdracht wordt vervangen door bericht) + + + Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s) + Transactiekosten (in %s/kB) kleiner dan dit worden beschouw dat geen transactiekosten in rekening worden gebracht voor doorgeven, mijnen en transactiecreatie (standaard: %s) If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) - Als paytxfee niet is ingesteld, het pakket voldoende vergoeding zodat transacties beginnen bevestiging gemiddeld binnen in blokken (default: %u) + Als paytxfee niet is ingesteld, voeg voldoende transactiekosten toe zodat transacties starten met bevestigingen binnen in n blokken (standaard: %u) Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions) - ongeldig bedrag voor -maxtxfee=<amount>: '%s' (moet ten minste de minrelay vergoeding van %s het voorkomen geplakt transacties voorkomen) + ongeldig bedrag voor -maxtxfee=<bedrag>: '%s' (moet ten minste de minimale doorgeeftransactiekosten van %s het voorkomen geplakt transacties voorkomen) Maximum size of data in data carrier transactions we relay and mine (default: %u) - Maximale grootte va n de gegevens in gegevensdrager transacties we relais en de mijnen -(default: %u) + Maximale grootte va n de gegevens in gegevensdragertransacties die we doorgeven en mijnen (standaard: %u) Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) - Query voor peer- adressen via DNS- lookup , als laag op adressen (default: 1 unless -connect) + Query voor peeradressen via DNS- lookup , als laag op adressen (standaard: 1 unless -connect) + + + Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u) + Gebruik willekeurige inloggegevens voor elke proxyverbinding. Dit maakt streamislatie voor Tor mogelijk (standaard: %u) Set maximum size of high-priority/low-fee transactions in bytes (default: %d) @@ -3050,7 +3269,7 @@ The transaction amount is too small to send after the fee has been deducted - Het transactiebedrag is te klein om te versturen nadat de vergoeding in mindering is gebracht + Het transactiebedrag is te klein om te versturen nadat de transactiekosten in mindering zijn gebracht This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. @@ -3058,7 +3277,11 @@ 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 - Goedgekeurde peers kunnen niet ge-DoS-banned worden en hun transacties worden altijd doorgestuurd, zelfs als ze reeds in de mempool aanwezig zijn, nuttig voor bijv. een gateway + 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 + + + You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain + U moet de database herbouwen met -reindex om terug te gaan naar de ongesnoeide modus. Dit zal de gehele blokkketen opnieuw downloaden. (default: %u) @@ -3066,12 +3289,24 @@ Accept public REST requests (default: %u) - Accepteer publieke REST-requests (standaard: %u) + Accepteer publieke REST-verzoeken (standaard: %u) Activating best chain... Beste reeks activeren... + + Always relay transactions received from whitelisted peers (default: %d) + Geef transacties altijd door aan goedgekeurde peers (standaard: %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Probeer privésleutels te herstellen van een corrupte wallet.dat bij opstarten + + + Automatically create Tor hidden service (default: %d) + Creëer automatisch verborgen dienst van Tor (standaard:%d) + Cannot resolve -whitebind address: '%s' Kan -whitebind adres niet herleiden: '%s' @@ -3092,6 +3327,10 @@ Error reading from database, shutting down. Fout bij het lezen van de database, afsluiten. + + Imports blocks from external blk000??.dat file on startup + Importeer blokken van externe blk000??.dat-bestand bij opstarten + Information Informatie @@ -3102,7 +3341,7 @@ Invalid amount for -maxtxfee=<amount>: '%s' - Ongeldig bedrag voor -maxtxfee=<amount>: '%s' + Ongeldig bedrag voor -maxtxfee=<bedrag>: '%s' Invalid amount for -minrelaytxfee=<amount>: '%s' @@ -3130,19 +3369,35 @@ Node relay options: - Node relay opties: + Nodedoorgeefopties: RPC server options: RPC server opties: + + Rebuild block chain index from current blk000??.dat files on startup + Herbouwen blokketenindex vanuit huidige blk000??.dat-bestanden bij opstarten? + + + Receive and display P2P network alerts (default: %u) + Ontvang en toon P2P-netwerkwaarschuwingen (standaard: %u) + + + Reducing -maxconnections from %d to %d, because of system limitations. + Verminder -maxconnections van %d naar %d, vanwege systeembeperkingen. + + + Rescan the block chain for missing wallet transactions on startup + Herscan de blokketen voor missende portemonneetransacties bij opstarten + Send trace/debug info to console instead of debug.log file - Stuur trace/debug-info naar de console in plaats van het debug.log bestand + Verzend trace/debug-info naar de console in plaats van het debug.log-bestand Send transactions as zero-fee transactions if possible (default: %u) - Verstuur transacties zonder verzendkosten indien mogelijk (standaard: %u) + Indien mogelijk, verstuur zonder transactiekosten (standaard: %u) Show all debugging options (usage: --help -help-debug) @@ -3158,12 +3413,20 @@ The transaction amount is too small to pay the fee - Het transactiebedrag is te klein om de vergoeding te betalen + Het transactiebedrag is te klein om transactiekosten in rekening te brengen This is experimental software. Dit is experimentele software. + + Tor control port password (default: empty) + Tor bepaalt poortwachtwoord (standaard: empty) + + + Tor control port to use if onion listening enabled (default: %s) + Tor bepaalt welke poort te gebruiken als luisteren naar onion wordt gebruikt (standaard: %s) + Transaction amount too small Transactiebedrag te klein @@ -3174,7 +3437,7 @@ Transaction too large for fee policy - De transactie is te groot voor het toeslagenbeleid + De transactie is te groot voor het transactiekostenbeleid Transaction too large @@ -3184,6 +3447,10 @@ Unable to bind to %s on this computer (bind returned error %s) Niet in staat om aan %s te binden op deze computer (bind gaf error %s) + + Upgrade wallet to latest format on startup + Upgrade portemonee naar laatste formaat bij opstarten + Username for JSON-RPC connections Gebruikersnaam voor JSON-RPC-verbindingen @@ -3196,10 +3463,18 @@ Warning Waarschuwing + + Whether to operate in a blocks only mode (default: %u) + Om in alleen een blokmodus te opereren (standaard: %u) + Zapping all transactions from wallet... Bezig met het zappen van alle transacties van de portemonnee... + + ZeroMQ notification options: + ZeroMQ notificatieopties: + wallet.dat corrupt, salvage failed wallet.dat corrupt, veiligstellen mislukt @@ -3210,7 +3485,7 @@ Execute command when the best block changes (%s in cmd is replaced by block hash) - Voer commando uit zodra het beste blok verandert (%s in cmd wordt vervangen door blockhash) + Voer opdracht uit zodra het beste blok verandert (%s in cmd wordt vervangen door blokhash) This help message @@ -3232,6 +3507,26 @@ (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) (1 = behoudt tx meta data bijv. account eigenaar en betalingsverzoek informatie, 2. sla tx meta data niet op) + + -maxtxfee is set very high! Fees this large could be paid on a single transaction. + -maxtxfee staat zeer hoog! Transactiekosten van de grootte kunnen worden gebruikt in een enkele transactie. + + + -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. + -paytxfee staat zeer hoog! Dit is de transactiekosten die u betaalt als u een transactie doet. + + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Bewaar transactie niet langer dan <n> uren in de geheugenpool (standaard: %u) + + + Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + Fout tijdens lezen van wallet.dat! Alle sleutels zijn correct te lezen, maar de transactiondatabase of adresboekingangen zijn mogelijk verdwenen of incorrect. + + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Transactiekosten (in %s/kB) kleiner dan dit worden beschouwd dat geen transactiekosten in rekening worden gebracht voor transactiecreatie (standaard: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Hoe grondig de blokverificatie van -checkblocks is (0-4, standaard: %u) @@ -3246,11 +3541,35 @@ Output debugging information (default: %u, supplying <category> is optional) - Output extra debugginginformatie (standaard: %u, het leveren van <category> is optioneel) + Output extra debugginginformatie (standaard: %u, het leveren van <categorie> is optioneel) + + + Support filtering of blocks and transaction with bloom filters (default: %u) + Ondersteun filtering van blokken en transacties met bloomfilters (standaard: %u) + + + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. + Totale lengte van netwerkversiestring (%i) overschrijdt maximale lengte (%i). Verminder het aantal of grootte van uacomments. + + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + Pogingen om uitgaand verkeer onder een bepaald doel te houden (in MiB per 24u), 0 = geen limiet (standaard: %d) + + + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Niet-ondersteund argument -socks gevonden. Instellen van SOCKS-versie is niet meer mogelijk, alleen SOCKS5-proxies worden ondersteund. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) - Gebruik een aparte SOCKS5 proxy om 'Tor hidden services' te bereiken (standaard: %s) + Gebruik een aparte SOCKS5 proxy om verborgen diensten van Tor te bereiken (standaard: %s) + + + 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. This option can be specified multiple times + Gebruikersnaam en gehasht wachtwoord voor JSON-RPC-verbindingen. De velden <userpw> is in het formaat: <GEBRUIKERSNAAM>:<SALT>$<HASH>. Een kanoniek Pythonscript is inbegrepen in de share/rpcuser. Deze optie kan meerdere keren worden meegegeven + + + (default: %s) + (standaard: %s) Always query for peer addresses via DNS lookup (default: %u) @@ -3278,7 +3597,7 @@ Listen for JSON-RPC connections on <port> (default: %u or testnet: %u) - Luister naar JSON-RPC-verbindingen op poort <port> (standaard: %u of testnet: %u) + Luister naar JSON-RPC-verbindingen op <poort> (standaard: %u of testnet: %u) Listen for connections on <port> (default: %u or testnet: %u) @@ -3298,7 +3617,7 @@ Maximum per-connection send buffer, <n>*1000 bytes (default: %u) - Maximum per-connectie zendbuffer, <n>*1000 bytes (standaard: %u) + Maximum per-connectie verstuurbuffer, <n>*1000 bytes (standaard: %u) Prepend debug output with timestamp (default: %u) @@ -3306,15 +3625,15 @@ Relay and mine data carrier transactions (default: %u) - Gegevensdrager transacties relay en de mijnen (default: %u) + Geef gegevensdragertransacties door en mijn ze ook (standaard: %u) Relay non-P2SH multisig (default: %u) - Relay non-P2SH multisig (default: %u) + Geef non-P2SH multisig door (standaard: %u) Set key pool size to <n> (default: %u) - Stel sleutelpoelgrootte in op <&> (standaard: %u) + Stel sleutelpoelgrootte in op <n> (standaard: %u) Set minimum block size in bytes (default: %u) @@ -3326,7 +3645,7 @@ Specify configuration file (default: %s) - Specificeer configuratie bestand (standaard: %s) + Specificeer configuratiebestand (standaard: %s) Specify connection timeout in milliseconds (minimum: 1, default: %d) @@ -3338,7 +3657,7 @@ Spend unconfirmed change when sending transactions (default: %u) - Besteed onbevestigd wisselgeld bij het versturen van transacties (standaard: %u) + Besteed onbevestigd wisselgeld bij het doen van transacties (standaard: %u) Threshold for disconnecting misbehaving peers (default: %u) @@ -3386,7 +3705,7 @@ Rescanning... - Blokketen aan het doorzoeken... + Blokketen aan het herscannen... Done loading diff --git a/src/qt/locale/bitcoin_pam.ts b/src/qt/locale/bitcoin_pam.ts index ec99a1f5729d0..233918ff2ba59 100644 --- a/src/qt/locale/bitcoin_pam.ts +++ b/src/qt/locale/bitcoin_pam.ts @@ -249,6 +249,10 @@ &Change Passphrase... &Alilan ing Passphrase... + + &Receiving addresses... + Address king pamag-Tanggap + Send coins to a Bitcoin address Magpadalang barya king Bitcoin address @@ -309,6 +313,10 @@ Bitcoin Core Kapilubluban ning Bitcoin + + &Command-line options + Pipamilian command-line + Last received block was generated %1 ago. Ing tatauling block a metanggap, me-generate ya %1 ing milabas @@ -363,6 +371,10 @@ CoinControlDialog + + Amount: + Alaga: + Amount Alaga @@ -464,7 +476,7 @@ command-line options pipamilian command-line - + Intro @@ -639,6 +651,10 @@ &Information &Impormasion + + Debug window + I-Debug ing awang + Using OpenSSL version Gagamit bersion na ning OpenSSL @@ -717,6 +733,10 @@ ReceiveRequestDialog + + Copy &Address + &Kopyan ing address + Address Address @@ -763,6 +783,18 @@ Send Coins Magpadalang Barya + + Insufficient funds! + Kulang a pondo + + + Amount: + Alaga: + + + Transaction Fee: + Bayad king Transaksion: + Send to multiple recipients at once Misanang magpadala kareng alialiuang tumanggap @@ -842,6 +874,14 @@ Alt+P Alt+P + + Message: + Mensayi: + + + Pay To: + Ibayad kang: + ShutdownWindow @@ -1365,10 +1405,26 @@ Failed to listen on any port. Use -listen=0 if you want this. Memali ya ing pamakiramdam kareng gang nanung port. Gamita me ini -listen=0 nung buri me ini. + + Cannot resolve -whitebind address: '%s' + Eya me-resolve ing -whitebind address: '%s' + Information &Impormasion + + Invalid amount for -maxtxfee=<amount>: '%s' + Eya maliari ing alaga keng -maxtxfee=<amount>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + Eya maliari ing alaga keng -minrelaytxfee=<amount>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Eya maliari ing alaga keng -mintxfee=<amount>: '%s' + Send trace/debug info to console instead of debug.log file Magpadalang trace/debug info okeng console kesa keng debug.log file diff --git a/src/qt/locale/bitcoin_pl.ts b/src/qt/locale/bitcoin_pl.ts index a351552b63ddc..8a8c377480996 100644 --- a/src/qt/locale/bitcoin_pl.ts +++ b/src/qt/locale/bitcoin_pl.ts @@ -878,6 +878,34 @@ command-line options opcje konsoli + + UI Options: + Opcje interfejsu + + + Choose data directory on startup (default: %u) + Katalog danych używany podczas uruchamiania programu (domyślny: %u) + + + Set language, for example "de_DE" (default: system locale) + Wybierz język, na przykład "de_DE" (domyślnie: język systemowy) + + + Start minimized + Uruchom zminimalizowany + + + Set SSL root certificates for payment request (default: -system-) + Ustaw certyfikaty główne SSL dla żądań płatności (domyślnie: -system-) + + + Show splash screen on startup (default: %u) + Wyświetl okno powitalne podczas uruchamiania (domyślnie: %u) + + + Reset all settings changes made over the GUI + Ustaw jako domyślne wszystkie ustawienia interfejsu + Intro @@ -1075,6 +1103,10 @@ Port of the proxy (e.g. 9050) Port proxy (np. 9050) + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Pokazuje, czy wspierane domyślnie proxy SOCKS5 jest używane do łączenia się z peerami w tej sieci + IPv4 IPv4 @@ -1087,6 +1119,10 @@ Tor Tor + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Użyj oddzielnego prozy SOCKS5 aby osiągnąć węzły w ukrytych usługach Tor: + &Window &Okno @@ -1457,6 +1493,14 @@ Current number of blocks Aktualna liczba bloków + + Current number of transactions + Obecna liczba transakcji + + + Memory usage + Zużycie pamięci + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Otwórz plik logowania debugowania Bitcoin Core z obecnego katalogu z danymi. Może to potrwać kilka sekund przy większych plikach. @@ -1481,6 +1525,10 @@ Select a peer to view detailed information. Wybierz węzeł żeby zobaczyć szczegóły. + + Whitelisted + Biała lista + Direction Kierunek @@ -1489,6 +1537,18 @@ Version Wersja + + Starting Block + Blok startowy + + + Synced Headers + Zsynchronizowane nagłówki + + + Synced Blocks + Zsynchronizowane bloki + User Agent Aplikacja kliencka @@ -1517,6 +1577,10 @@ Ping Time Czas odpowiedzi + + Ping Wait + Czas odpowiedzi + Time Offset Przesunięcie czasu @@ -1601,6 +1665,10 @@ %1 GB %1 GB + + (node id: %1) + (id węzła: %1) + via %1 przez %1 @@ -1648,6 +1716,10 @@ 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. Użyj jednego z poprzednio użytych adresów odbiorczych. Podczas ponownego używania adresów występują problemy z bezpieczeństwem i prywatnością. Nie korzystaj z tej opcji, chyba że odtwarzasz żądanie płatności wykonane już wcześniej. + + R&euse an existing receiving address (not recommended) + U&żyj ponownie istniejącego adresu odbiorczego (niepolecane) + 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. 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. @@ -1989,6 +2061,10 @@ Copy change Skopiuj resztę + + Total Amount %1 + Łączna kwota %1 + or lub @@ -2656,6 +2732,10 @@ Copy transaction ID Skopiuj ID transakcji + + Copy raw transaction + Skopiuj surowe dane transakcji + Edit label Zmień etykietę @@ -2807,6 +2887,10 @@ Error: A fatal internal error occurred, see debug.log for details Błąd: Wystąpił fatalny błąd wewnętrzny, sprawdź szczegóły w debug.log + + Fee (in %s/kB) to add to transactions you send (default: %s) + Prowizja (w %s/kB) dodawana do wysyłanych transakcji (domyślnie: %s) + Pruning blockstore... Przycinanie zapisu bloków... @@ -2815,6 +2899,10 @@ Run in the background as a daemon and accept commands Uruchom w tle jako daemon i przyjmuj polecenia + + Unable to start HTTP server. See debug log for details. + Uruchomienie serwera HTTP nie powiodło się. Zobacz dziennik debugowania, aby uzyskać więcej szczegółów. + Accept connections from outside (default: 1 if no -proxy or -connect) Akceptuj połączenia z zewnątrz (domyślnie: 1 jeśli nie ustawiono -proxy lub -connect) @@ -2967,6 +3055,14 @@ Specify wallet file (within data directory) Określ plik portfela (w obrębie folderu danych) + + Unsupported argument -benchmark ignored, use -debug=bench. + Niewspierany argument -benchmark zignorowany, użyj -debug=bench. + + + Unsupported argument -debugnet ignored, use -debug=net. + Niewspierany argument -debugnet zignorowany, użyj -debug=net. + Use UPnP to map the listening port (default: %u) Użyj UPnP do przekazania portu nasłuchu (domyślnie : %u) @@ -3075,6 +3171,18 @@ Activating best chain... Aktywuje najlepszy łańcuch + + Always relay transactions received from whitelisted peers (default: %d) + Zawsze przekazuj informacje o transakcjach otrzymanych od osób z białej listy (domyślnie: %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Próbuj podczas uruchamiania programu odzyskać klucze prywatne z uszkodzonego pliku wallet.dat + + + Automatically create Tor hidden service (default: %d) + Stwórz automatycznie ukrytą usługę Tora (domyślnie: %d) + Cannot resolve -whitebind address: '%s' Nie można rozwiązać adresu -whitebind: '%s' @@ -3095,6 +3203,10 @@ Error reading from database, shutting down. Błąd odczytu z bazy danych, wyłączam się. + + Imports blocks from external blk000??.dat file on startup + Importuj bloki z zewnętrznego pliku blk000??.dat podczas uruchamiania programu + Information Informacja @@ -3127,6 +3239,10 @@ Keep at most <n> unconnectable transactions in memory (default: %u) Przechowuj w pamięci maksymalnie <n> transakcji nie możliwych do połączenia (domyślnie: %u) + + Need to specify a port with -whitebind: '%s' + Musisz określić port z -whitebind: '%s' + Node relay options: Opcje przekaźnikowe węzła: @@ -3143,6 +3259,10 @@ Receive and display P2P network alerts (default: %u) Odbieranie i wyświetlanie alertów sieci P2P (domyślnie: %u) + + Rescan the block chain for missing wallet transactions on startup + Przeskanuj podczas ładowania programu łańcuch bloków w poszukiwaniu zaginionych transakcji portfela + Send trace/debug info to console instead of debug.log file Wyślij informację/raport do konsoli zamiast do pliku debug.log. @@ -3171,6 +3291,10 @@ This is experimental software. To oprogramowanie eksperymentalne. + + Tor control port password (default: empty) + Hasło zabezpieczające portu kontrolnego Tora (domyślnie: puste) + Transaction amount too small Zbyt niska kwota transakcji @@ -3191,6 +3315,10 @@ Unable to bind to %s on this computer (bind returned error %s) Nie można przywiązać do %s na tym komputerze (bind zwrócił błąd %s) + + Upgrade wallet to latest format on startup + Zaktualizuj portfel do najnowszego formatu podczas ładowania programu + Username for JSON-RPC connections Nazwa użytkownika dla połączeń JSON-RPC @@ -3239,6 +3367,14 @@ (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) (1 = zachowaj wysłane metadane np. właściciel konta i informacje o żądaniach płatności, 2 = porzuć wysłane metadane) + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Nie trzymaj w pamięci transakcji starszych niż <n> godzin (domyślnie: %u) + + + Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + Ostrzeżenie: błąd odczytu wallet.dat! Wszystkie klucze zostały odczytane, ale może brakować pewnych danych transakcji lub wpisów w książce adresowej lub mogą one być nieprawidłowe. + How thorough the block verification of -checkblocks is (0-4, default: %u) Jak dokładna jest weryfikacja bloków przy -checkblocks (0-4, domyślnie: %u) @@ -3255,6 +3391,10 @@ Output debugging information (default: %u, supplying <category> is optional) Wypuść informacje debugowania (domyślnie: %u, podanie <category> jest opcjonalne) + + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Znaleziono niewspierany argument -socks. Wybieranie wersji SOCKS nie jest już możliwe, wsparcie programu obejmuje tylko proxy SOCKS5 + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Użyj oddzielnego prozy SOCKS5 aby osiągnąć węzły w ukrytych usługach Tor (domyślnie: %s) diff --git a/src/qt/locale/bitcoin_pt_BR.ts b/src/qt/locale/bitcoin_pt_BR.ts index bb6de064d4664..5cea349fbc3f4 100644 --- a/src/qt/locale/bitcoin_pt_BR.ts +++ b/src/qt/locale/bitcoin_pt_BR.ts @@ -441,6 +441,10 @@ No block source available... Nenhum servidor disponível... + + Processed %n block(s) of transaction history. + %n bloco processado do histórico de transações.%n blocos processados do histórico de transações. + %n hour(s) %n hora%n horas @@ -878,6 +882,34 @@ command-line options opções da linha de comando + + UI Options: + Opções de Interface: + + + Choose data directory on startup (default: %u) + Escolher diretório de dados na inicialização (padrão: %u) + + + Set language, for example "de_DE" (default: system locale) + Definir idioma, por exemplo "de_DE" (padrão: idioma do sistema) + + + Start minimized + Iniciar minimizado + + + Set SSL root certificates for payment request (default: -system-) + Definir certificados de root SSL para requisições de pagamento (padrão: -sistema-) + + + Show splash screen on startup (default: %u) + Exibir tela de abertura na inicialização (padrão: %u) + + + Reset all settings changes made over the GUI + Desfazer todas as mudanças de configuração feitas na interface + Intro @@ -1079,6 +1111,10 @@ Used for reaching peers via: Usado para alcançar participantes via: + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Exibe, caso o proxy padrão SOCKS5 fornecido seja usado para se conectar a peers através deste tipo de rede. + IPv4 IPv4 @@ -1469,6 +1505,18 @@ Current number of blocks Quantidade atual de blocos + + Memory Pool + Pool de Memória + + + Current number of transactions + Número atual de transações + + + Memory usage + Uso de memória + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Abrir o arquivo de log de depuração do Bitcoin na pasta de dados atual. Isso pode demorar para arquivos grandes. @@ -2883,14 +2931,26 @@ If <category> is not supplied or if <category> = 1, output all debugging information. Se <category> não for suprida ou se <category> = 1, mostrar toda informação de depuração. + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Total máximo de comissão (em %s) que será usado em uma única transação; um valor muito baixo pode cancelar uma transação grande (padrão: %s) + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. Por favor verifique se a data e horário estão corretos no seu computador! Se o seu relógio estiver incorreto, a Carteira Bitcoin não irá funcionar corretamente. + + Prune configured below the minimum of %d MiB. Please use a higher number. + Corte configurado abaixo do nível mínimo de %d de MiB. Por favor use um número mais alto. + Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) Corte: a ultima sincronização da carteira foi além do dado comprimido. Você precisa reindexar ( -reindex , faça o download de toda a blockchain novamente) + + Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files) + Reduza os requerimentos de armazenamento de dados (cortando) deletando blocos mais antigos. Esse modo é incompatível com -txindex e -rescan. Cuidado: Reverter essa configuração requer um novo download de toda a blockchain. (Padrão: 0 = desabilita o corte de blocos, >%u = tamanho alvo em MiB para o uso de blocos cortados) + Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again. Rescans não são possíveis no modo de corte. Você precisa usar -reindex, que irá fazer o download de toda a blockchain novamente. @@ -3175,14 +3235,38 @@ Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Executa um comando quando um alerta relevante é recebido ou vemos uma longa segregação (%s em cmd é substituído pela mensagem) + + Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s) + Comissões (em %s/kB) menores serão consideradas como zero para relaying, mineração e criação de transação (padrão %s) + + + If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) + 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) + + + Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions) + Valor inválido para -maxtxfee = <valor>: '%s'( precisa ser pelo menos a comissão mínima de %s para prevenir travamento de transações) + + + Maximum size of data in data carrier transactions we relay and mine (default: %u) + Tamanho máximo de dados em transações de dados de operadora (padrão %u) + Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect) Buscar por endereços de peers via busca DNS, se estiver baixo em endereços (padrão: 1 a não ser que -connect) + + Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u) + Gerar credenciais aleatórias para cada conexão por proxy. Isto habilita o isolamento de stream do Tor (padrão: %u) + Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Define o tamanho máximo de alta-prioridade por taxa baixa nas transações em bytes (padrão: %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Determina o número de núcleos para a geração de moedas se ativado (-1 = todos os núcleos, padrão: %d) + The transaction amount is too small to send after the fee has been deducted A quantia da transação é muito pequena para mandar @@ -3191,6 +3275,10 @@ This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Esse produto inclui software desenvolvido pelo Open SSL Project para uso na OpenSSL Toolkit<https://www.openssl.org/> e software criptográfico escrito por Eric Young e software UPnP escrito por Thomas Bernard. + + 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 + Peers permitidos não podem ser banidos do DoS e suas transações sempre são transmitidas, até mesmo se eles já estão no pool de memória, útil, por exemplo, para um gateway + You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain Você precisa reconstruir o banco de dados usando -reindex para sair do modo prune. Isso irá rebaixar todo o blockchain. @@ -3199,10 +3287,26 @@ (default: %u) (padrão: %u) + + Accept public REST requests (default: %u) + Aceitar pedidos restantes públicas (padrão: %u) + Activating best chain... Ativando a melhor sequência... + + Always relay transactions received from whitelisted peers (default: %d) + Sempre transmitir transações recebidas de peers confiáveis (padrão: %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Tentar recuperar na inicialização chaves privadas de um arquivo wallet.dat corrompido + + + Automatically create Tor hidden service (default: %d) + Criar automaticamente serviços ocultos do Tor (padrão: %d) + Cannot resolve -whitebind address: '%s' Impossível resolver endereço -whitebind: '%s' @@ -3223,10 +3327,18 @@ Error reading from database, shutting down. Erro ao ler o banco de dados. Finalizando. + + Imports blocks from external blk000??.dat file on startup + Importar blocos a partir de arquivo externo blk000??.dat durante a inicialização + Information Informação + + Initialization sanity check failed. Bitcoin Core is shutting down. + O teste de integridade da inicialização falhou. O Core do Bitcoin está sendo desligado. + Invalid amount for -maxtxfee=<amount>: '%s' Quantidade inválida para -maxtxfee=<quantidade>: '%s' @@ -3247,6 +3359,10 @@ Invalid netmask specified in -whitelist: '%s' Máscara de rede especificada em -whitelist: '%s' é inválida + + Keep at most <n> unconnectable transactions in memory (default: %u) + Manter ao máximo <n> transações inconectáveis na memória (padrão: %u) + Need to specify a port with -whitebind: '%s' Necessário informar uma porta com -whitebind: '%s' @@ -3259,9 +3375,13 @@ RPC server options: Opções do servidor RPC: + + Rebuild block chain index from current blk000??.dat files on startup + Reconstruir índice de cadeia de bloco a partir dos arquivos blk000??.dat atuais durante a inicialização + Receive and display P2P network alerts (default: %u) - Receba e mostre P2P alerta de rede (default: %u) + Receba e mostre P2P alerta de rede (padrão: %u) Send trace/debug info to console instead of debug.log file @@ -3355,6 +3475,14 @@ Error loading wallet.dat: Wallet corrupted Erro ao carregar wallet.dat: Carteira corrompida + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Comissões (em %s/kB) menores serão consideradas como zero para criação de transação (padrão %s) + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) + Use um proxy SOCKS5 separado para alcançar participantes da rede via serviços ocultos Tor (padrão: %s) + (default: %s) (padrão: %s) @@ -3399,13 +3527,21 @@ Make the wallet broadcast transactions Fazer a carteira transmitir transações + + Maximum per-connection receive buffer, <n>*1000 bytes (default: %u) + Buffer máximo de recebimento por conexão, <n>*1000 bytes (padrão: %u) + Prepend debug output with timestamp (default: %u) - Adiciona timestamp como prefixo no debug (default: %u) + Adiciona timestamp como prefixo no debug (padrão: %u) Relay non-P2SH multisig (default: %u) - Retransmitir P2SH não multisig (default: %u) + Retransmitir P2SH não multisig (padrão: %u) + + + Set key pool size to <n> (default: %u) + Defina o tamanho da chave para piscina<n> (padrão: %u) Set minimum block size in bytes (default: %u) @@ -3425,7 +3561,7 @@ Specify pid file (default: %s) - Especificar aqrquivo pid (default: %s) + Especificar aqrquivo pid (padrão: %s) Spend unconfirmed change when sending transactions (default: %u) diff --git a/src/qt/locale/bitcoin_pt_PT.ts b/src/qt/locale/bitcoin_pt_PT.ts index b5ede206dd74f..ffed44a61c20c 100644 --- a/src/qt/locale/bitcoin_pt_PT.ts +++ b/src/qt/locale/bitcoin_pt_PT.ts @@ -874,7 +874,7 @@ command-line options opções da linha de comandos - + Intro @@ -2916,6 +2916,10 @@ (default: %u) (por defeito: %u) + + Cannot resolve -whitebind address: '%s' + Não foi possível resolver o endereço -whitebind: '%s' + Copyright (C) 2009-%i The Bitcoin Core Developers Copyright (C) 2009-%i Os Programadores do Bitcoin Core @@ -2928,6 +2932,10 @@ Information Informação + + Invalid amount for -maxtxfee=<amount>: '%s' + Quantia inválida para -maxtxfee=<quantidade>: '%s' + Invalid amount for -minrelaytxfee=<amount>: '%s' Quantia inválida para -minrelaytxfee=<quantidade>: '%s' @@ -3004,6 +3012,10 @@ Error loading wallet.dat: Wallet corrupted Erro ao carregar wallet.dat: Carteira danificada + + (default: %s) + (por defeito: %s) + Error loading wallet.dat Erro ao carregar wallet.dat diff --git a/src/qt/locale/bitcoin_ro_RO.ts b/src/qt/locale/bitcoin_ro_RO.ts index c88908263aa90..8bccf037a73c7 100644 --- a/src/qt/locale/bitcoin_ro_RO.ts +++ b/src/qt/locale/bitcoin_ro_RO.ts @@ -709,6 +709,10 @@ lowest cea mai scăzută + + (%1 locked) + (%1 blocat) + none nimic @@ -737,6 +741,10 @@ no nu + + This means a fee of at least %1 per kB is required. + Aceasta înseamnă o taxă de cel puţin %1 pe kB necesar. + Can vary +/- 1 byte per input. Poate varia +/- 1 octet pentru fiecare intrare. @@ -866,7 +874,7 @@ command-line options Opţiuni linie de comandă - + Intro @@ -881,6 +889,10 @@ As this is the first time the program is launched, you can choose where Bitcoin Core will store its data. Dacă aceasta este prima dată cînd programul este lansat, puteţi alege unde Nucleul Bitcoin va stoca datele. + + Bitcoin Core will download and store a copy of the Bitcoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + Nucleul Bitcoin se va descărca şi va stoca o copie a lanţului blocului Bitcoin. Cel puţin %1GB de date vor fi stocate în acest dosar şi se va mări în timp. Portofelul va fi, de asemenea, stocat în acest dosar. + Use the default data directory Foloseşte dosarul de date implicit @@ -2335,6 +2347,10 @@ , has not been successfully broadcast yet , nu s-a propagat încă + + Open for %n more block(s) + Deschis pentru încă %n blocDeschis pentru încă %n blocuriDeschis pentru încă %n de blocuri + unknown necunoscut @@ -2365,6 +2381,10 @@ Immature (%1 confirmations, will be available after %2) Imatur (%1 confirmări, va fi disponibil după %2) + + Open for %n more block(s) + Deschis pentru încă %n blocDeschis pentru încă %n blocuriDeschis pentru încă %n de blocuri + Open until %1 Deschis până la %1 @@ -2847,10 +2867,18 @@ This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit <https://www.openssl.org/> and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard. Acest produs include programe dezvoltate de către Proiectul OpenSSL pentru a fi folosite în OpenSSL Toolkit <https://www.openssl.org/> şi programe criptografice scrise de către Eric Young şi programe UPnP scrise de către Thomas Bernard. + + (default: %u) + (implicit: %u) + Accept public REST requests (default: %u) Acceptă cererile publice REST (implicit: %u) + + Cannot resolve -whitebind address: '%s' + Nu se poate rezolva adresa -whitebind: '%s' + Connect through SOCKS5 proxy Conectare prin proxy SOCKS5 diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index ea577694ac8ba..00dfd833abfa2 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -93,7 +93,11 @@ Exporting Failed Экспорт не удался - + + There was an error trying to save the address list to %1. Please try again. + Произошла ошибка при попытке сохранить список адресов, %1. Пожалуйста, попробуйте еще раз. + + AddressTableModel @@ -878,6 +882,34 @@ command-line options параметры командной строки + + UI Options: + Настройки интерфейса: + + + Choose data directory on startup (default: %u) + Выбрать каталог данных при запуске (по умолчанию: %u) + + + Set language, for example "de_DE" (default: system locale) + Выберите язык, например "de_DE" (по умолчанию: как в системе) + + + Start minimized + Запускать свёрнутым + + + Set SSL root certificates for payment request (default: -system-) + Указать корневые SSL-сертификаты для запроса платежа (по умолчанию: -system-) + + + Show splash screen on startup (default: %u) + Показывать экран-заставку при запуске (по умолчанию: %u) + + + Reset all settings changes made over the GUI + Сбросить все настройки сделанные через графический интерфейс + Intro @@ -1473,6 +1505,18 @@ Current number of blocks Текущее число блоков + + Memory Pool + Пул памяти + + + Current number of transactions + Текущее число транзакций + + + Memory usage + Использование памяти + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Открыть отладочный лог-файл Bitcoin Core из текущего каталога данных. Это может занять несколько секунд для больших лог-файлов. @@ -2093,6 +2137,14 @@ Payment request expired. Запрос платежа просрочен. + + Pay only the required fee of %1 + Заплатить только обязательную комиссию %1 + + + Estimated to begin confirmation within %n block(s). + Подтверждение ожидается через %n блок.Подтверждение ожидается через %n блока.Подтверждение ожидается через %n блоков.Подтверждение ожидается через %n блоков. + The recipient address is not valid. Please recheck. Адрес получателя неверный. Пожалуйста, перепроверьте. @@ -2589,6 +2641,10 @@ Unconfirmed Неподтверждено + + Confirming (%1 of %2 recommended confirmations) + Подтверждено(%1 подтверждений, рекомендуется %2 подтверждений) + Conflicted В противоречии @@ -3467,6 +3523,10 @@ Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Ошибка чтения wallet.dat! Все ключи прочитаны верно, но данные транзакций или записи адресной книги могут отсутствовать или быть неправильными. + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Комиссии (в %s/Кб) меньшие этого значения считаются нулевыми при создании транзакций (по умолчанию: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Насколько тщательна проверка контрольных блоков -checkblocks (0-4, по умолчанию: %u) @@ -3483,6 +3543,10 @@ Output debugging information (default: %u, supplying <category> is optional) Выводить отладочную информацию (по умолчанию: %u, указание <category> необязательно) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Поддерживать фильтрацию блоков и транзакций с помощью фильтра Блума (по умолчанию: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. Текущая длина строки версии сети (%i) превышает максимальную длину (%i). Увеливается количество или размер uacomments. @@ -3499,6 +3563,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Использовать отдельный прокси SOCKS5 для соединения с участниками через скрытые сервисы Tor (по умолчанию: %s) + + 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. This option can be specified multiple times + Имя пользователя и хэш пароля для JSON-RPC соединений. Поле <userpw> использует формат: <USERNAME>:<SALT>$<HASH>. Каноничный пример скрипта на питоне включен в "share/rpcuser". Эта опция может быть указана несколько раз + (default: %s) (по умолчанию: %s) @@ -3567,6 +3635,10 @@ Set key pool size to <n> (default: %u) Установить размер пула ключей в <n> (по умолчанию: %u) + + Set minimum block size in bytes (default: %u) + Задать минимальный размер блока в байтах (по умолчанию: %u) + Set the number of threads to service RPC calls (default: %d) Задать число потоков выполнения запросов RPC (по умолчанию: %d) diff --git a/src/qt/locale/bitcoin_ru_RU.ts b/src/qt/locale/bitcoin_ru_RU.ts index fa42dfaaad453..53a1c1d8a40b9 100644 --- a/src/qt/locale/bitcoin_ru_RU.ts +++ b/src/qt/locale/bitcoin_ru_RU.ts @@ -17,6 +17,14 @@ Bitcoin Core Bitcoin Core + + &About Bitcoin Core + О Bitcoin Core + + + &Command-line options + Опции командной строки + Error Ошибка @@ -88,6 +96,10 @@ Command-line options Опции командной строки + + command-line options + Опции командной строки + Intro @@ -131,6 +143,10 @@ RPCConsole + + &Information + Информация + ReceiveCoinsDialog diff --git a/src/qt/locale/bitcoin_sk.ts b/src/qt/locale/bitcoin_sk.ts index 0451b1485e35c..8c779cbe98665 100644 --- a/src/qt/locale/bitcoin_sk.ts +++ b/src/qt/locale/bitcoin_sk.ts @@ -874,7 +874,7 @@ command-line options voľby príkazového riadku - + Intro @@ -1071,6 +1071,10 @@ Port of the proxy (e.g. 9050) Port proxy (napr. 9050) + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Použiť samostatný SOCKS5 proxy server na dosiahnutie počítačov cez skryté služby Tor: + &Window Okno @@ -3161,6 +3165,10 @@ The network does not appear to fully agree! Some miners appear to be experiencin Error loading wallet.dat Chyba načítania wallet.dat + + Generate coins (default: %u) + Generovať mince (predvolené: %u) + How many blocks to check at startup (default: %u, 0 = all) Koľko blokov overiť pri spustení (predvolené: %u, 0 = všetky) diff --git a/src/qt/locale/bitcoin_sl_SI.ts b/src/qt/locale/bitcoin_sl_SI.ts index f26e350545ef1..c62c8cf273054 100644 --- a/src/qt/locale/bitcoin_sl_SI.ts +++ b/src/qt/locale/bitcoin_sl_SI.ts @@ -874,7 +874,7 @@ command-line options možnosti ukazne vrstice - + Intro @@ -917,7 +917,11 @@ %n GB of free space available %n GiB prostega prostora na voljo%n GiB prostega prostora na voljo%n GiB prostega prostora na voljo%n GiB prostega prostora na voljo - + + (of %n GB needed) + (od potrebnih %n GiB)(od potrebnih %n GiB)(od potrebnih %n GiB)(od potrebnih %n GiB) + + OpenURIDialog @@ -1067,6 +1071,10 @@ Port of the proxy (e.g. 9050) Vrata posredniškega strežnika (npr. 9050) + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Za dostop do soležnikov preko skritih storitev Tor uporabi drug posredniški strežnik SOCKS5: + &Window O&kno @@ -3019,6 +3027,18 @@ Information Informacije + + Invalid amount for -maxtxfee=<amount>: '%s' + Neveljavna količina za -maxtxfee=<amount>: '%s' + + + Invalid amount for -minrelaytxfee=<amount>: '%s' + Neveljavna količina za -minrelaytxfee=<amount>: '%s' + + + Invalid amount for -mintxfee=<amount>: '%s' + Neveljavna količina za -mintxfee=<amount>: '%s' + Need to specify a port with -whitebind: '%s' Pri opciji -whitebind morate navesti vrata: %s diff --git a/src/qt/locale/bitcoin_sq.ts b/src/qt/locale/bitcoin_sq.ts index 769b45b562c68..994b065994e38 100644 --- a/src/qt/locale/bitcoin_sq.ts +++ b/src/qt/locale/bitcoin_sq.ts @@ -201,6 +201,10 @@ &Options... &Opsione + + &Receiving addresses... + Duke marr adresen + Change the passphrase used for wallet encryption Ndrysho frazkalimin e përdorur per enkriptimin e portofolit @@ -421,6 +425,10 @@ Options Opsionet + + W&allet + Portofol + OverviewPage @@ -447,6 +455,10 @@ RPCConsole + + &Information + Informacion + &Open &Hap @@ -466,13 +478,25 @@ ReceiveCoinsDialog + + &Amount: + Shuma: + &Label: &Etiketë: + + Clear + Pastro + ReceiveRequestDialog + + Copy &Address + &Kopjo adresen + Address Adresë @@ -511,6 +535,10 @@ Send Coins Dërgo Monedha + + Insufficient funds! + Fonde te pamjaftueshme + Amount: Shuma: @@ -570,6 +598,10 @@ Alt+P Alt+P + + Pay To: + Paguaj drejt: + ShutdownWindow @@ -621,6 +653,10 @@ Date Data + + Transaction + transaksionit + Amount Sasia @@ -757,6 +793,10 @@ bitcoin-core + + Options: + Opsionet: + Information Informacion diff --git a/src/qt/locale/bitcoin_sr.ts b/src/qt/locale/bitcoin_sr.ts index 425c077b2b83e..b6ba896b38f54 100644 --- a/src/qt/locale/bitcoin_sr.ts +++ b/src/qt/locale/bitcoin_sr.ts @@ -221,6 +221,10 @@ Tabs toolbar Трака са картицама + + &About Bitcoin Core + O Bitcoin Coru + Up to date Ажурно @@ -337,6 +341,10 @@ Options Поставке + + W&allet + новчаник + &Unit to show amounts in: &Јединица за приказивање износа: @@ -374,10 +382,18 @@ ReceiveCoinsDialog + + &Amount: + Iznos: + &Label: &Етикета + + &Message: + Poruka: + Copy label kopiraj naziv @@ -389,6 +405,10 @@ ReceiveRequestDialog + + Copy &Address + Kopirajte adresu + Address Адреса @@ -401,6 +421,10 @@ Label Етикета + + Message + Poruka + RecentRequestsTableModel @@ -412,6 +436,10 @@ Label Етикета + + Message + Poruka + Amount iznos @@ -450,6 +478,10 @@ SendCoinsEntry + + A&mount: + Iznos: + &Label: &Етикета @@ -513,6 +545,14 @@ label етикета + + Message + Poruka + + + Transaction + transakcije + Amount iznos diff --git a/src/qt/locale/bitcoin_sv.ts b/src/qt/locale/bitcoin_sv.ts index 18f096b841f3e..756114351f880 100644 --- a/src/qt/locale/bitcoin_sv.ts +++ b/src/qt/locale/bitcoin_sv.ts @@ -738,6 +738,10 @@ Var vänlig och försök igen. This label turns red if any recipient receives an amount smaller than %1. Denna etikett blir röd om någon mottagare får ett belopp mindre än %1. + + Can vary +/- %1 satoshi(s) per input. + Kan variera +/- %1 satoshi per inmatning. + yes ja @@ -879,6 +883,34 @@ Var vänlig och försök igen. command-line options kommandoradsalternativ + + UI Options: + UI-inställningar: + + + Choose data directory on startup (default: %u) + Välj datakatalog vid uppstart (standard: %u) + + + Set language, for example "de_DE" (default: system locale) + Ange språk, till exempel "de_DE" (standard: systemspråk) + + + Start minimized + Starta minimerad + + + Set SSL root certificates for payment request (default: -system-) + Ange SSL rotcertifikat för betalningsansökan (standard: -system-) + + + Show splash screen on startup (default: %u) + Visa startbild vid uppstart (standard: %u) + + + Reset all settings changes made over the GUI + Återställ alla inställningar som gjorts över GUI + Intro @@ -1474,6 +1506,18 @@ Var vänlig och försök igen. Current number of blocks Aktuellt antal block + + Memory Pool + Minnespool + + + Current number of transactions + Nuvarande antal transaktioner + + + Memory usage + Minnesåtgång + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Öppna felsökningsloggfilen för Bitcoin Core från den nuvarande datakatalogen. Detta kan ta några sekunder om loggfilen är stor. @@ -1697,6 +1741,10 @@ Var vänlig och försök igen. ReceiveCoinsDialog + + &Amount: + &Belopp: + &Label: &Etikett: @@ -2181,6 +2229,10 @@ Var vänlig och försök igen. 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. Avgiften dras från beloppet som skickas. Mottagaren kommer att få mindre bitcoins än du angivit i belopp-fältet. Om flera mottagare valts kommer avgiften delas jämt. + + S&ubtract fee from amount + S&ubtrahera avgiften från beloppet + Message: Meddelande: @@ -3212,6 +3264,10 @@ Var vänlig och försök igen. Set maximum size of high-priority/low-fee transactions in bytes (default: %d) Sätt den maximala storleken av hög-prioriterade/låg-avgifts transaktioner i byte (förvalt: %d) + + Set the number of threads for coin generation if enabled (-1 = all cores, default: %d) + Ange antalet trådar för myntgenerering om påslagen (-1= alla kärnor, förval: %d) + The transaction amount is too small to send after the fee has been deducted Transaktionen är för liten att skicka efter det att avgiften har dragits @@ -3468,6 +3524,10 @@ Var vänlig och försök igen. Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Fel vid läsning av wallet.dat! Alla nycklar lästes korrekt, men transaktionsdata eller adressbokens poster kanske saknas eller är felaktiga. + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Avgifter (i %s/kB) mindre än detta anses vara nollavgifter vid skapande av transaktion (standard: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Hur grundlig blockverifikationen vid -checkblocks är (0-4, förvalt: %u) @@ -3484,6 +3544,10 @@ Var vänlig och försök igen. Output debugging information (default: %u, supplying <category> is optional) Skriv ut avlusningsinformation (förvalt: %u, att ange <category> är frivilligt) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Stöd filtrering av block och transaktioner med bloomfilter (standard: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. Total längd på strängen för nätverksversion (%i) överskrider maxlängden (%i). Minska numret eller storleken på uacomments. @@ -3500,6 +3564,10 @@ Var vänlig och försök igen. Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Använd separat SOCKS5 proxy för att nå kollegor via dolda tjänster i Tor (förvalt: -%s) + + 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. This option can be specified multiple times + Användarnamn och hashat lösenord för JSON-RPC-anslutningar. Fältet <userpw> kommer i formatet: <USERNAME>:<SALT>$<HASH>. Ett kanoniskt pythonskript finns inkluderat i share/rpcuser. Detta alternativ kan anges flera gånger + (default: %s) (förvalt: %s) diff --git a/src/qt/locale/bitcoin_th_TH.ts b/src/qt/locale/bitcoin_th_TH.ts index 75fdfc5bdfb66..79a55cdd518b5 100644 --- a/src/qt/locale/bitcoin_th_TH.ts +++ b/src/qt/locale/bitcoin_th_TH.ts @@ -282,6 +282,10 @@ ReceiveCoinsDialog + + &Label: + &ชื่อ: + ReceiveRequestDialog @@ -318,6 +322,10 @@ SendCoinsEntry + + &Label: + &ชื่อ: + ShutdownWindow @@ -385,5 +393,9 @@ bitcoin-core + + Options: + ตัวเลือก: + \ No newline at end of file diff --git a/src/qt/locale/bitcoin_tr.ts b/src/qt/locale/bitcoin_tr.ts index 36ca1ab6fe509..96fca8bb24f44 100644 --- a/src/qt/locale/bitcoin_tr.ts +++ b/src/qt/locale/bitcoin_tr.ts @@ -222,7 +222,15 @@ BanTableModel - + + IP/Netmask + IP/Ağ maskesi + + + Banned Until + Şu vakte kadar yasaklı: + + BitcoinGUI @@ -874,6 +882,34 @@ command-line options komut satırı seçenekleri + + UI Options: + Arayüz Seçenekleri: + + + Choose data directory on startup (default: %u) + Başlangıçta veri klasörü seç (varsayılan: %u) + + + Set language, for example "de_DE" (default: system locale) + Lisan belirt, mesela "de_De" (varsayılan: sistem dili) + + + Start minimized + Küçültülmüş olarak başlat + + + Set SSL root certificates for payment request (default: -system-) + Ödeme talebi için SSL kök sertifikalarını belirle (varsayılan: -system-) + + + Show splash screen on startup (default: %u) + Başlatıldığında başlangıç ekranını göster (varsayılan: %u) + + + Reset all settings changes made over the GUI + Arayüzde yapılan tüm seçenek değişikliklerini sıfırla + Intro @@ -1071,6 +1107,34 @@ Port of the proxy (e.g. 9050) Vekil sunucunun portu (mesela 9050) + + Used for reaching peers via: + Eşlere ulaşmak için kullanılır, şu yoluyla: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + 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. + + + IPv4 + IPv4 + + + IPv6 + IPv6 + + + Tor + Tor + + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + Bitcoin şebekesine gizli Tor servisleri için ayrı bir SOCKS5 vekil sunucusu vasıtasıyla bağlan. + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + Eşlere gizli Tor servisleri ile ulaşmak için ayrı SOCKS5 vekil sunucusu kullan: + &Window &Pencere @@ -1441,6 +1505,18 @@ Current number of blocks Güncel blok sayısı + + Memory Pool + Bellek Alanı + + + Current number of transactions + Güncel muamele sayısı + + + Memory usage + Bellek kullanımı + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Güncel veri klasöründen Bitcoin Çekirdeği hata ayıklama kütük dosyasını açar. Büyük kütük dosyaları için bu birkaç saniye alabilir. @@ -1457,10 +1533,18 @@ &Peers &Eşler + + Banned peers + Yasaklı eşler + Select a peer to view detailed information. Ayrıntılı bilgi görmek için bir eş seçin. + + Whitelisted + Beyaz listedekiler + Direction Yön @@ -1469,6 +1553,18 @@ Version Sürüm + + Starting Block + Başlangıç Bloku + + + Synced Headers + Eşleşmiş Başlıklar + + + Synced Blocks + Eşleşmiş Bloklar + User Agent Kullanıcı Yazılımı @@ -1497,6 +1593,14 @@ Ping Time Ping Süresi + + The duration of a currently outstanding ping. + Güncel olarak göze çarpan bir ping'in süresi. + + + Ping Wait + Ping Beklemesi + Time Offset Saat Farkı @@ -1545,6 +1649,34 @@ Clear console Konsolu temizle + + &Disconnect Node + Düğümle Bağlantıyı &Kes + + + Ban Node for + Düğümü şu süre için yasakla: + + + 1 &hour + 1 &saat + + + 1 &day + 1 &gün + + + 1 &week + 1 &hafta + + + 1 &year + 1 &yıl + + + &Unban Node + Düğümün Yasağını Kald&ır + Welcome to the Bitcoin Core RPC console. Bitcoin Çekirdeği RPC konsoluna hoş geldiniz. @@ -1573,6 +1705,10 @@ %1 GB %1 GB + + (node id: %1) + (düğüm kimliği: %1) + via %1 %1 vasıtasıyla @@ -1965,6 +2101,10 @@ Copy change Para üstünü kopyala + + Total Amount %1 + Toplam Meblağ %1 + or veya @@ -1997,6 +2137,14 @@ Payment request expired. Ödeme talebinin ömrü doldu. + + Pay only the required fee of %1 + Sadece gerekli ücret olan %1 tutarını öde + + + Estimated to begin confirmation within %n block(s). + Tahmini olarak %n blok içinde teyide başlanacaktır.Tahmini olarak %n blok içinde teyide başlanacaktır. + The recipient address is not valid. Please recheck. Alıcı adresi geçerli değildir. Lütfen denetleyiniz. @@ -2628,6 +2776,10 @@ Copy transaction ID Muamele kimliğini kopyala + + Copy raw transaction + Ham muameleyi kopyala + Edit label Etiketi düzenle @@ -2775,10 +2927,54 @@ Accept command line and JSON-RPC commands Komut satırı ve JSON-RPC komutlarını kabul et + + If <category> is not supplied or if <category> = 1, output all debugging information. + Eğer <kategori> belirtilmemişse ya da <kategori> = 1 ise, tüm hata ayıklama verilerini dök. + + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + Tek cüzdan muamelesinde kullanılacak azami toplam ücret (%s olarak); bunu çok düşük olarak ayarlamak büyük muameleleri iptal edebilir (varsayılan: %s) + + + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + Lütfen bilgisayarınızın saat ve tarihinin doğru olduğunu kontol ediniz! Saatinizde gecikme varsa Bitcoin Çekirdeği doğru şekilde çalışamaz. + + + Prune configured below the minimum of %d MiB. Please use a higher number. + Prune, asgari değer olan %d MiB'den düşük olarak ayarlanmıştır. Lütfen daha yüksek bir sayı kullanınız. + + + Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) + 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.) + + + Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files) + Depolama gerekliliğini eski blokları budayarak (silerek) düşür. Bu kip -txindex ve -rescan ile uyumsuzdur. İkaz: Bu ayarı geri almak tüm blok zincirini yeniden indirmeyi gerektirir. (varsayılan: 0 = blokları silmeyi devre dışı bırak, >%u = MiB olarak blok dosyaları için kullanılacak hedef boyut) + + + Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again. + Tekrar taramalar budanmış kipte mümkün değildir. Tüm blok zincirini tekrar indirecek olan -reindex seçeneğini kullanmanız gerekecektir. + + + Error: A fatal internal error occurred, see debug.log for details + Hata: Ölümcül dahili bir hata meydana geldi, ayrıntılar için debug.log dosyasına bakınız + + + Fee (in %s/kB) to add to transactions you send (default: %s) + Yolladığınız muamelelere eklenecek ücret (%s/kB olarak) (varsayılan: %s) + + + Pruning blockstore... + Blockstore budanıyor... + Run in the background as a daemon and accept commands Arka planda daemon (servis) olarak çalış ve komutları kabul et + + Unable to start HTTP server. See debug log for details. + HTTP sunucusu başlatılamadı. Ayrıntılar için debug.log dosyasına bakınız. + Accept connections from outside (default: 1 if no -proxy or -connect) Dışarıdan gelen bağlantıları kabul et (varsayılan: -proxy veya -connect yoksa 1) @@ -2803,6 +2999,10 @@ Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) Betik kontrolü iş parçacıklarının sayısını belirler (%u ilâ %d, 0 = otomatik, <0 = bu sayıda çekirdeği kullanma, varsayılan: %d) + + 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 + 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. + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications Bu yayın öncesi bir deneme sürümüdür - tüm riski siz üstlenmiş olursunuz - bitcoin oluşturmak ya da ticari uygulamalar için kullanmayınız @@ -2811,6 +3011,10 @@ Unable to bind to %s on this computer. Bitcoin Core is probably already running. Bu bilgisayarda %s unsuruna bağlanılamadı. Bitcoin Çekirdeği muhtemelen hâlihazırda çalışmaktadır. + + Use UPnP to map the listening port (default: 1 when listening and no -proxy) + Dinlenecek portu haritalamak için UPnP kullan (varsayılan: dinlenildiğinde ve -proxy olmadığında 1) + WARNING: abnormally high number of blocks generated, %d blocks received in the last %d hours (%d expected) İKAZ: anormal yüksek sayıda blok oluşturulmuştur, %d blok son %d saat içinde alınmıştır (%d bekleniyordu) @@ -2835,6 +3039,10 @@ Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. Belirtilen ağ maskesi ya da IP adresinden bağlanan eşleri beyaz listeye al. Birden fazla kez belirtilebilir. + + -maxmempool must be at least %d MB + -maxmempool asgari %d MB olmalıdır + <category> can be: <kategori> şunlar olabilir: @@ -2867,6 +3075,22 @@ Do you want to rebuild the block database now? Blok veritabanını şimdi yeniden inşa etmek istiyor musunuz? + + Enable publish hash block in <address> + Blok karma değerinin <adres>te yayınlanmasını etkinleştir + + + Enable publish hash transaction in <address> + Karma değer muamelesinin <adres>te yayınlanmasını etkinleştir + + + Enable publish raw block in <address> + Ham blokun <adres>te yayınlanmasını etkinleştir + + + Enable publish raw transaction in <address> + Ham muamelenin <adres>te yayınlanmasını etkinleştir + Error initializing block database Blok veritabanını başlatılırken bir hata meydana geldi @@ -2903,6 +3127,10 @@ Invalid -onion address: '%s' Geçersiz -onion adresi: '%s' + + Keep the transaction memory pool below <n> megabytes (default: %u) + Muamele bellek alanını <n> megabayttan düşük tut (varsayılan: %u) + Not enough file descriptors available. Kafi derecede dosya tanımlayıcıları mevcut değil. @@ -2931,10 +3159,26 @@ Specify wallet file (within data directory) Cüzdan dosyası belirtiniz (veri klasörünün içinde) + + Unsupported argument -benchmark ignored, use -debug=bench. + Desteklenmeyen -benchmark argümanı görmezden gelindi, -debug=bench kullanınız. + + + Unsupported argument -debugnet ignored, use -debug=net. + Desteklenmeyen -debugnet argümanı görmezden gelindi, debug=net kullanınız. + + + Unsupported argument -tor found, use -onion. + Deskteklenmeyen -tor argümanı bulundu, -onion kullanınız. + Use UPnP to map the listening port (default: %u) Dinleme portunu haritalamak için UPnP kullan (varsayılan: %u) + + User Agent comment (%s) contains unsafe characters. + Kullanıcı Aracı açıklaması (%s) güvensiz karakterler içermektedir. + Verifying blocks... Bloklar kontrol ediliyor... @@ -2991,6 +3235,10 @@ Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) İ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) + + Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s) + Bundan düşük ücretler (%s/kB olarak) aktarma, oluşturma ve muamele yaratma için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s) + If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) Eğer paytxfee ayarlanmadıysa kafi derecede ücret ekleyin ki muameleler teyite vasati n blok içinde başlasın (varsayılan: %u) @@ -3047,6 +3295,18 @@ Activating best chain... En iyi zincir etkinleştiriliyor... + + Always relay transactions received from whitelisted peers (default: %d) + Beyaz listedeki eşlerden gelen muameleleri daima aktar (varsayılan: %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Başlangıçta bozuk bir wallet.dat dosyasından özel anahtarları geri kazanmayı dene + + + Automatically create Tor hidden service (default: %d) + Otomatik olarak gizli Tor servisi oluştur (varsayılan: %d) + Cannot resolve -whitebind address: '%s' -whitebind adresi çözümlenemedi: '%s' @@ -3067,6 +3327,10 @@ Error reading from database, shutting down. Veritabanından okumada hata, kapatılıyor. + + Imports blocks from external blk000??.dat file on startup + Başlangıçta harici blk000??.dat dosyasından blokları içe aktarır + Information Bilgi @@ -3119,6 +3383,14 @@ Receive and display P2P network alerts (default: %u) P2P ağından gelen önemli uyarıları alın ve gösterin (önseçili değer: %u) + + Reducing -maxconnections from %d to %d, because of system limitations. + Sistem sınırlamaları sebebiyle -maxconnections %d değerinden %d değerine düşürülmüştür. + + + Rescan the block chain for missing wallet transactions on startup + Başlangıçta blok zincirini eksik cüzdan muameleleri için tekrar tara + Send trace/debug info to console instead of debug.log file Trace/hata ayıklama verilerini debug.log dosyası yerine konsola gönder @@ -3147,6 +3419,14 @@ This is experimental software. Bu, deneysel bir yazılımdır. + + Tor control port password (default: empty) + Tor kontrol portu parolası (varsayılan: boş) + + + Tor control port to use if onion listening enabled (default: %s) + Eğer onion dinlenmesi etkinse kullanılacak Tor kontrol portu (varsayılan: %s) + Transaction amount too small Muamele meblağı çok düşük @@ -3167,6 +3447,10 @@ Unable to bind to %s on this computer (bind returned error %s) Bu bilgisayarda %s unsuruna bağlanılamadı (bağlanma %s hatasını verdi) + + Upgrade wallet to latest format on startup + Başlangıçta cüzdanı en yeni biçime güncelle + Username for JSON-RPC connections JSON-RPC bağlantıları için kullanıcı ismi @@ -3179,10 +3463,18 @@ Warning Uyarı + + Whether to operate in a blocks only mode (default: %u) + Salt blok kipinde çalışılıp çalışılmayacağı (varsayılan: %u) + Zapping all transactions from wallet... Cüzdandaki tüm muameleler kaldırılıyor... + + ZeroMQ notification options: + ZeroMQ bildirim seçenekleri: + wallet.dat corrupt, salvage failed wallet.dat bozuk, geri kazanım başarısız oldu @@ -3215,6 +3507,26 @@ (1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data) (1 = tx meta verilerini tut mesela hesap sahibi ve ödeme talebi bilgileri, 2 = tx meta verilerini at) + + -maxtxfee is set very high! Fees this large could be paid on a single transaction. + -maxtxfee çok yüksek bir değere ayarlanmış! Bu denli yüksek ücretler tek bir muamelede ödenebilir. + + + -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. + -paytxfee çok yüksek bir değere ayarlanmış! Bu, muamele gönderirseniz ödeyeceğiniz muamele ücretidir. + + + Do not keep transactions in the mempool longer than <n> hours (default: %u) + Muameleleri bellek alanında <n> saatten fazla tutma (varsayılan: %u) + + + Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. + wallet.dat dosyasının okunması sırasında bir hata meydana geldi! Tüm anahtarlar doğru bir şekilde okundu, ancak muamele verileri ya da adres defteri unsurları hatalı veya eksik olabilir. + + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Bundan düşük ücretler (%s/kB olarak) muamele oluşturulması için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) -checkblocks'un blok kontrolünün ne kadar kapsamlı olacağı (0 ilâ 4, varsayılan: %u) @@ -3231,10 +3543,30 @@ Output debugging information (default: %u, supplying <category> is optional) Hata ayıklama bilgisi dök (varsayılan: %u, <kategori> sağlanması seçime dayalıdır) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Blokların ve muamelelerin bloom filtreleri ile süzülmesini destekle (varsayılan: %u) + + + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. + Şebeke sürümü zincirinin toplam boyutu (%i) azami boyutu geçmektedir (%i). Kullanıcı aracı açıklamasının sayısı veya boyutunu azaltınız. + + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + Giden trafiği belirtilen hedefin altında tutmaya çalışır (24 saat başı MiB olarak), 0 = sınırsız (varsayılan: %d) + + + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. + Desteklenmeyen -socks argümanı bulundu. SOCKS sürümünün ayarlanması artık mümkün değildir, sadece SOCKS5 vekilleri desteklenmektedir. + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Eşlere gizli Tor servisleri ile ulaşmak için ayrı SOCKS5 vekil sunucusu kullan (varsayılan: %s) + + 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. This option can be specified multiple times + JSON-RPC bağlantıları için kullanıcı ismi ve karmalanmış parola. <userpw> alanı şu biçimdedir: <USERNAME>:<SALT>$<HASH>. Kanonik bir Python betiği share/rpcuser klasöründe bulunabilir. Bu seçenek birden çok kez belirtilebilir. + (default: %s) (varsayılan: %s) diff --git a/src/qt/locale/bitcoin_tr_TR.ts b/src/qt/locale/bitcoin_tr_TR.ts index bca64ba05dba2..10866b011b867 100644 --- a/src/qt/locale/bitcoin_tr_TR.ts +++ b/src/qt/locale/bitcoin_tr_TR.ts @@ -117,6 +117,10 @@ BitcoinGUI + + &Receiving addresses... + Alış adresleri + ClientModel @@ -130,6 +134,14 @@ EditAddressDialog + + &Label + Etiket + + + &Address + Adres + FreespaceChecker @@ -169,6 +181,10 @@ ReceiveRequestDialog + + Copy &Address + &Adresi Kopyala + Address Adres diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index 5e2a06c7317bb..ea783aa8569ca 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -882,6 +882,34 @@ command-line options параметри командного рядка + + UI Options: + Параметри інтерфейсу: + + + Choose data directory on startup (default: %u) + Обирати каталог даних під час запуску (типово: %u) + + + Set language, for example "de_DE" (default: system locale) + Встановити мову (наприклад: "de_DE") (типово: системна) + + + Start minimized + Запускати згорнутим + + + Set SSL root certificates for payment request (default: -system-) + Вказати кореневі SSL-сертифікати для запиту платежу (типово: -системні-) + + + Show splash screen on startup (default: %u) + Показувати заставку під час запуску (типово: %u) + + + Reset all settings changes made over the GUI + Скинути налаштування, які було змінено через графічний інтерфейс користувача + Intro @@ -1083,6 +1111,10 @@ Used for reaching peers via: Приєднуватися до учасників через: + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + Вказує на використання наявного типового проксі SOCKS5, що використувується задля встановлення зв'язку з пірами через мережу такого типу. + IPv4 IPv4 @@ -1473,6 +1505,18 @@ Current number of blocks Поточне число блоків + + Memory Pool + Пул пам'яті + + + Current number of transactions + Поточне число транзакцій + + + Memory usage + Використання пам'яті + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. Відкрити файл журналу налагодження Bitcoin Core з поточного каталогу даних. Це може зайняти кілька секунд для великих файлів журналів. @@ -2057,6 +2101,10 @@ Copy change Копіювати решту + + Total Amount %1 + Всього %1 + or або @@ -2089,6 +2137,10 @@ Payment request expired. Запит платежу прострочено. + + Pay only the required fee of %1 + Сплатіть лише мінімальну комісію у розмірі %1 + Estimated to begin confirmation within %n block(s). Перше підтвердження очікується протягом %n блоку.Перше підтвердження очікується протягом %n блоків.Перше підтвердження очікується протягом %n блоків. @@ -2724,6 +2776,10 @@ Copy transaction ID Скопіювати ID транзакції + + Copy raw transaction + Скопіювати RAW транзакцію + Edit label Редагувати мітку @@ -2887,6 +2943,10 @@ Prune configured below the minimum of %d MiB. Please use a higher number. Встановлений розмір ланцюжка блоків є замалим (меншим за %d МіБ). Будь ласка, виберіть більше число. + + Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node) + Операція відсікання: остання синхронізація вмісту гаманцю не обмежується діями над скороченими данними. Вам необхідно зробити переіндексацію -reindex (заново завантажити веcь ланцюжок блоків в разі появи скороченого ланцюга) + Reduce storage requirements by pruning (deleting) old blocks. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files) Зменшити вимоги до наявного простору на носії даних за допомогою скорочення ланцюжка (видалення старих блоків). Цей режим несумісний з параметрами -txindex та -rescan. Увага: при поверненні до типового значення видалені частини ланцюжка буде повторно завантажено. (типово: 0 = вимкнути скорочення ланцюжка, >%u = очікуваний розмір файлів блоків в МіБ) @@ -3015,6 +3075,22 @@ Do you want to rebuild the block database now? Ви хочете перебудувати базу даних блоків зараз? + + Enable publish hash block in <address> + Дозволено введення хеш блоку в рядок <address> + + + Enable publish hash transaction in <address> + Дозволено введення хеш транзакції в рядок <address> + + + Enable publish raw block in <address> + Дозволено введення RAW блоку в рядок <address> + + + Enable publish raw transaction in <address> + Дозволено введення RAW транзакції в рядок <address> + Error initializing block database Помилка ініціалізації бази даних блоків @@ -3159,6 +3235,10 @@ Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message) Виконати команду при надходженні важливого сповіщення або при спостереженні тривалого розгалуження ланцюжка (замість %s буде підставлено повідомлення) + + Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s) + Комісії (в %s/kB), що менші за вказану, вважатимуться нульовими для зміни, аналізу та створення транзакцій (типово: %s) + If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u) Якщо параметр paytxfee не встановлено, включити комісію для отримання перших підтверджень транзакцій протягом n блоків (типово: %u) @@ -3215,6 +3295,18 @@ Activating best chain... Активація найкращого ланцюжка... + + Always relay transactions received from whitelisted peers (default: %d) + Завжди передавайте транзакції отримані від пірів з білого списку (типово: %d) + + + Attempt to recover private keys from a corrupt wallet.dat on startup + Спочатку спробуйте відновити приватні ключі в пошкодженому wallet.dat + + + Automatically create Tor hidden service (default: %d) + Автоматичне з'єднання з прихованим сервісом Tor (типово: %d) + Cannot resolve -whitebind address: '%s' Не вдалося розпізнати адресу для -whitebind: «%s» @@ -3235,6 +3327,10 @@ Error reading from database, shutting down. Помилка читання бази даних, припиняю роботу. + + Imports blocks from external blk000??.dat file on startup + Спочатку імпортує блоки з зовнішнього файлу blk000??.dat + Information Інформація @@ -3291,6 +3387,10 @@ Reducing -maxconnections from %d to %d, because of system limitations. Зменшення значення -maxconnections з %d до %d із-за обмежень системи. + + Rescan the block chain for missing wallet transactions on startup + Спочатку переглянте ланцюжок блоків на наявність втрачених транзакцій гаманця + Send trace/debug info to console instead of debug.log file Відсилати налагоджувальну інформацію на консоль, а не у файл debug.log @@ -3319,6 +3419,14 @@ This is experimental software. Це програмне забезпечення є експериментальним. + + Tor control port password (default: empty) + Пароль управління порт протоколом Tor (типово: empty) + + + Tor control port to use if onion listening enabled (default: %s) + Скористайтесь управлінням порт протоколом Tor, в разі перехоплення обміну цибулевої маршрутизації (типово: %s) + Transaction amount too small Сума транзакції занадто мала @@ -3339,6 +3447,10 @@ Unable to bind to %s on this computer (bind returned error %s) Неможливо прив'язатися до %s на цьому комп'ютері (bind повернув помилку: %s) + + Upgrade wallet to latest format on startup + Спочатку оновіть гаманець до останньої версії + Username for JSON-RPC connections Ім'я користувача для JSON-RPC-з'єднань @@ -3351,6 +3463,10 @@ Warning Попередження + + Whether to operate in a blocks only mode (default: %u) + Чи слід працювати в режимі тільки блоки (типово: %u) + Zapping all transactions from wallet... Видалення всіх транзакцій з гаманця... @@ -3407,6 +3523,10 @@ Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. Помилка читання wallet.dat! Всі ключі прочитано коректно, але дані транзакцій чи записи адресної книги можуть бути пропущені або пошкоджені. + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + Комісії (в %s/kB), що менші за вказану, вважатимуться нульовими для створення транзакцій (типово: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) Рівень ретельності перевірки блоків (0-4, типово: %u) @@ -3423,10 +3543,18 @@ Output debugging information (default: %u, supplying <category> is optional) Виводити налагоджувальну інформацію (типово: %u, вказання <category> необов'язкове) + + Support filtering of blocks and transaction with bloom filters (default: %u) + Фільтрація блоків та транзакцій з допомогою фільтрів Блума (типово: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. Загальна довжина рядку мережевої версії (%i) перевищує максимально допустиму (%i). Зменшіть число чи розмір коментарів клієнта користувача. + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + Намагається зберегти вихідний трафік відповідно до зданого значення (в MIB за 24 години), 0 = без обмежень (типово: %d) + Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported. Параметр -socks не підтримується. Можливість вказувати версію SOCKS було видалено, так як підтримується лише SOCKS5. @@ -3435,6 +3563,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) Використовувати окремий SOCKS5-проксі для з'єднання з учасниками через приховані сервіси Tor (типово: %s) + + 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. This option can be specified multiple times + Логін та хешований пароль для зв'язків JSON-RPC. Поле <userpw> має формат: <USERNAME>:<SALT>$<HASH>. Класичний Python script додано до share/rpcuser. Цей параметр може бути застосований декілька разів. + (default: %s) (типово: %s) diff --git a/src/qt/locale/bitcoin_ur_PK.ts b/src/qt/locale/bitcoin_ur_PK.ts index db5cca3ccadbd..e37c87baa84f2 100644 --- a/src/qt/locale/bitcoin_ur_PK.ts +++ b/src/qt/locale/bitcoin_ur_PK.ts @@ -123,6 +123,10 @@ CoinControlDialog + + Amount: + رقم: + Amount رقم @@ -138,6 +142,14 @@ EditAddressDialog + + &Label + چٹ + + + &Address + پتہ + FreespaceChecker @@ -185,6 +197,10 @@ ReceiveRequestDialog + + Copy &Address + کاپی پتہ + Address پتہ @@ -219,6 +235,14 @@ SendCoinsDialog + + Insufficient funds! + ناکافی فنڈز + + + Amount: + رقم: + Balance: بیلنس: diff --git a/src/qt/locale/bitcoin_uz@Cyrl.ts b/src/qt/locale/bitcoin_uz@Cyrl.ts index 4350d0ac8a80d..86724564ffc07 100644 --- a/src/qt/locale/bitcoin_uz@Cyrl.ts +++ b/src/qt/locale/bitcoin_uz@Cyrl.ts @@ -792,6 +792,10 @@ About Bitcoin Core Bitcoin Core ҳақида + + Command-line options + Буйруқлар сатри мосламалари + Usage: Фойдаланиш: @@ -800,7 +804,7 @@ command-line options буйруқлар қатори орқали мослаш - + Intro @@ -905,6 +909,10 @@ &Network Тармоқ + + W&allet + Ҳамён + Proxy &IP: Прокси &IP рақами: @@ -1690,6 +1698,10 @@ Message: Хабар + + Pay To: + Тўлов олувчи: + ShutdownWindow @@ -2018,6 +2030,10 @@ Export Transaction History Ўтказмалар тарихини экспорт қилиш + + Watch-only + Фақат кўришга + Exporting Failed Экспорт қилиб бўлмади @@ -2137,6 +2153,10 @@ Loading addresses... Манзиллар юкланмоқда... + + Insufficient funds + Кам миқдор + Loading block index... Тўсиқ индекси юкланмоқда... diff --git a/src/qt/locale/bitcoin_vi.ts b/src/qt/locale/bitcoin_vi.ts index 7a7c68c4b3b26..47745a3bc8ed0 100644 --- a/src/qt/locale/bitcoin_vi.ts +++ b/src/qt/locale/bitcoin_vi.ts @@ -59,6 +59,10 @@ CoinControlDialog + + Amount: + Số lượng: + Amount Số lượng @@ -70,6 +74,14 @@ EditAddressDialog + + &Label + Nhãn dữ liệu + + + &Address + Địa chỉ + FreespaceChecker @@ -113,6 +125,10 @@ ReceiveRequestDialog + + Copy &Address + Sao chép địa chỉ + Address Địa chỉ @@ -143,6 +159,10 @@ SendCoinsDialog + + Amount: + Số lượng: + (no label) (chưa có nhãn) diff --git a/src/qt/locale/bitcoin_vi_VN.ts b/src/qt/locale/bitcoin_vi_VN.ts index c55aecd82dab2..d55fa618855fd 100644 --- a/src/qt/locale/bitcoin_vi_VN.ts +++ b/src/qt/locale/bitcoin_vi_VN.ts @@ -165,6 +165,10 @@ Show information about Qt Xem thông tin về Qt + + &Receiving addresses... + Địa chỉ nhận + Open &URI... Mở &URI... @@ -354,6 +358,14 @@ EditAddressDialog + + &Label + Nhãn + + + &Address + Địa chỉ + FreespaceChecker @@ -417,6 +429,10 @@ MB MB + + W&allet + + &Display &Hiển thị @@ -467,6 +483,10 @@ RPCConsole + + &Information + Thông tin + General Nhìn Chung @@ -490,6 +510,10 @@ ReceiveCoinsDialog + + &Amount: + Lượng: + Copy label Copy nhãn @@ -501,6 +525,10 @@ ReceiveRequestDialog + + Copy &Address + &Copy Địa Chỉ + Address Địa chỉ @@ -535,6 +563,10 @@ SendCoinsDialog + + Insufficient funds! + Không đủ tiền + Quantity: Lượng: @@ -570,6 +602,10 @@ SendCoinsEntry + + A&mount: + Lượng: + ShutdownWindow @@ -673,6 +709,14 @@ bitcoin-core + + Options: + Lựa chọn: + + + (default: %u) + (mặc định: %u) + Information Thông tin diff --git a/src/qt/locale/bitcoin_zh.ts b/src/qt/locale/bitcoin_zh.ts index 288c1c5f25d15..aeb4faa712283 100644 --- a/src/qt/locale/bitcoin_zh.ts +++ b/src/qt/locale/bitcoin_zh.ts @@ -87,6 +87,10 @@ SendCoinsDialog + + Insufficient funds! + 余额不足 + Choose... 选择... diff --git a/src/qt/locale/bitcoin_zh_CN.ts b/src/qt/locale/bitcoin_zh_CN.ts index 778462e6814ec..0ae2c95c62a1a 100644 --- a/src/qt/locale/bitcoin_zh_CN.ts +++ b/src/qt/locale/bitcoin_zh_CN.ts @@ -23,7 +23,7 @@ C&lose - 关闭(&C) + 关闭(&l) &Copy Address @@ -133,7 +133,7 @@ Encrypt wallet - 钱包加密 + 加密钱包 This operation needs your wallet passphrase to unlock the wallet. @@ -226,7 +226,11 @@ IP/Netmask IP/网络掩码 - + + Banned Until + 在此之前禁止: + + BitcoinGUI @@ -267,7 +271,7 @@ About &Qt - 关于 &Qt + 关于Qt(&Q) Show information about Qt @@ -303,7 +307,7 @@ Bitcoin Core client - 比特币核心钱包 + 比特币核心钱包客户端 Importing blocks from disk... @@ -311,7 +315,7 @@ Reindexing blocks on disk... - 正在为数据块建立索引... + 正在为数据块重建索引... Send coins to a Bitcoin address @@ -878,6 +882,34 @@ command-line options 命令行选项 + + UI Options: + 界面选项: + + + Choose data directory on startup (default: %u) + 在启动时选择目录(默认%u) + + + Set language, for example "de_DE" (default: system locale) + 设置语言, 例如“zh-CN”(默认:系统语言) + + + Start minimized + 启动时最小化 + + + Set SSL root certificates for payment request (default: -system-) + 设置付款请求的SSL根证书(默认:-系统-) + + + Show splash screen on startup (default: %u) + 显示启动画面(默认:%u) + + + Reset all settings changes made over the GUI + 重置所有图形界面所做的更改 + Intro @@ -1075,6 +1107,14 @@ Port of the proxy (e.g. 9050) 代理端口(例如 9050) + + Used for reaching peers via: + 连接到同伴的方式: + + + Shows, if the supplied default SOCKS5 proxy is used to reach peers via this network type. + 如果默认的SOCKS5代理被用于在该网络下连接同伴,则显示 + IPv4 IPv4 @@ -1087,6 +1127,14 @@ Tor Tor + + Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services. + 在Tor匿名网络下通过不同的SOCKS5代理连接比特币网络 + + + Use separate SOCKS5 proxy to reach peers via Tor hidden services: + 通过Tor隐藏服务连接节点时 使用不同的SOCKS5代理 + &Window 窗口(&W) @@ -1457,6 +1505,18 @@ Current number of blocks 当前数据块数量 + + Memory Pool + 资金池 + + + Current number of transactions + 当前交易数量 + + + Memory usage + 内存使用 + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. 从当前的数据目录打开比特币核心调试日志文件。对于较大的日志文件,这可能需要几秒钟。 @@ -1473,6 +1533,10 @@ &Peers 同伴(&P) + + Banned peers + 节点黑名单 + Select a peer to view detailed information. 选择节点查看详细信息。 @@ -1489,6 +1553,10 @@ Version 版本 + + Starting Block + 正在启动数据块 + Synced Headers 同步区块头 @@ -1525,6 +1593,10 @@ Ping Time Ping 时间 + + Ping Wait + Ping等待 + Time Offset 时间偏移 @@ -1573,6 +1645,14 @@ Clear console 清空控制台 + + &Disconnect Node + (&D)断开节点连接 + + + Ban Node for + 禁止节点连接时长: + 1 &hour 1 小时(&H) @@ -1589,6 +1669,10 @@ 1 &year 1 年(&Y) + + &Unban Node + (&U)允许节点连接 + Welcome to the Bitcoin Core RPC console. 欢迎使用 比特币核心 RPC 控制台。 @@ -2013,6 +2097,10 @@ Copy change 复制零钱 + + Total Amount %1 + 总金额 %1 + or @@ -2045,6 +2133,10 @@ Payment request expired. 支付请求已过期。 + + Pay only the required fee of %1 + 只支付必要费用 %1 + Estimated to begin confirmation within %n block(s). 预计 %n 个数据块后被确认。 @@ -2680,6 +2772,10 @@ Copy transaction ID 复制交易编号 + + Copy raw transaction + 复制原始交易 + Edit label 编辑标签 @@ -2830,10 +2926,34 @@ 接受命令行和 JSON-RPC 命令 + + If <category> is not supplied or if <category> = 1, output all debugging information. + 如果<category>未提供或<category> = 1,输出所有调试信息。 + + + Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s) + 最大单次转账费用(%s),设置太低可能导致大宗交易失败(默认:%s) + + + Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly. + 警请检查电脑的日期时间设置是否正确!时间错误可能会导致比特币客户端运行异常。 + + + Prune configured below the minimum of %d MiB. Please use a higher number. + 修剪值被设置为低于最小值%d MiB,请使用更大的数值。 + + + Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again. + 无法在开启修剪的状态下重扫描,请使用 -reindex重新下载完整的区块链。 + Error: A fatal internal error occurred, see debug.log for details 错误:发生了致命的内部错误,详情见 debug.log 文件 + + Fee (in %s/kB) to add to transactions you send (default: %s) + 为付款交易添加交易费 (%s/kB) (默认: %s) + Pruning blockstore... 正在修剪区块存储... @@ -2844,6 +2964,10 @@ + + Unable to start HTTP server. See debug log for details. + 无法启动HTTP服务,查看日志获取更多信息 + Accept connections from outside (default: 1 if no -proxy or -connect) 接受来自外部的连接 (缺省: 如果不带 -proxy or -connect 参数设置为1) @@ -2868,6 +2992,10 @@ Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d) 设置脚本验证的程序 (%u 到 %d, 0 = 自动, <0 = 保留自由的核心, 默认值: %d) + + 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 + 区块数据库包含未来的交易,这可能是由本机错误的日期时间引起。若确认本机日期时间正确,请重新建立区块数据库。 + This is a pre-release test build - use at your own risk - do not use for mining or merchant applications 这是测试用的预发布版本 - 请谨慎使用 - 不要用来挖矿,或者在正式商用环境下使用 @@ -2876,6 +3004,10 @@ Unable to bind to %s on this computer. Bitcoin Core is probably already running. 无法 %s的绑定到电脑上,比特币核心钱包可能已经在运行。 + + Use UPnP to map the listening port (default: 1 when listening and no -proxy) + 使用UPnP暴露本机监听端口(默认:1 当正在监听且不使用代理) + WARNING: abnormally high number of blocks generated, %d blocks received in the last %d hours (%d expected) 警告:数据块生成数量异常,最近 %d 小时收到了 %d 个数据块(预期为 %d 个) @@ -2900,6 +3032,10 @@ Whitelist peers connecting from the given netmask or IP address. Can be specified multiple times. 节点白名单,网络掩码或IP址。可多次指定。 + + -maxmempool must be at least %d MB + -maxmempool 最小为%d MB + <category> can be: <category> 可能是: @@ -2932,6 +3068,22 @@ Do you want to rebuild the block database now? 你想现在就重建块数据库吗? + + Enable publish hash block in <address> + 允许在<address>广播哈希区块 + + + Enable publish hash transaction in <address> + 允许在<address>广播哈希交易 + + + Enable publish raw block in <address> + 允许在<address>广播原始区块 + + + Enable publish raw transaction in <address> + 允许在<address>广播原始交易 + Error initializing block database 初始化数据块数据库出错 @@ -2968,6 +3120,10 @@ Invalid -onion address: '%s' 无效的 -onion 地址:“%s” + + Keep the transaction memory pool below <n> megabytes (default: %u) + 保持交易内存池大小低于<n>MB(默认:%u) + Not enough file descriptors available. 没有足够的文件描述符可用。 @@ -2996,6 +3152,18 @@ Specify wallet file (within data directory) 指定钱包文件(数据目录内) + + Unsupported argument -benchmark ignored, use -debug=bench. + 忽略不支持的选项 -benchmark,使用 -debug=bench + + + Unsupported argument -debugnet ignored, use -debug=net. + 忽略不支持的选项 -debugnet,使用 -debug=net。 + + + Unsupported argument -tor found, use -onion. + 忽略不支持的选项 -tor,使用 -oinon + Use UPnP to map the listening port (default: %u) 使用UPnp映射监听端口 (默认: %u) @@ -3160,6 +3328,10 @@ Invalid netmask specified in -whitelist: '%s' -whitelist: '%s' 指定的网络掩码无效 + + Keep at most <n> unconnectable transactions in memory (default: %u) + 内存中最多保留 <n> 笔孤立的交易 (默认: %u) + Need to specify a port with -whitebind: '%s' -whitebind: '%s' 需要指定一个端口 @@ -3180,6 +3352,10 @@ Receive and display P2P network alerts (default: %u) 收到并且显示P2P网络的告警(默认:%u) + + Rescan the block chain for missing wallet transactions on startup + 重新扫描区块链以查找遗漏的钱包交易 + Send trace/debug info to console instead of debug.log file 跟踪/调试信息输出到控制台,不输出到 debug.log 文件 @@ -3228,6 +3404,10 @@ Unable to bind to %s on this computer (bind returned error %s) 无法在此计算机上绑定 %s (绑定返回错误 %s) + + Upgrade wallet to latest format on startup + 程序启动时升级钱包到最新格式 + Username for JSON-RPC connections JSON-RPC 连接用户名 @@ -3240,6 +3420,10 @@ Warning 警告 + + Whether to operate in a blocks only mode (default: %u) + 是否用块方进行 (%u) + Zapping all transactions from wallet... Zapping all transactions from wallet... @@ -3298,6 +3482,10 @@ Output debugging information (default: %u, supplying <category> is optional) 输出调试信息 (默认: %u, 提供 <category> 是可选项) + + Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d) + 尝试保持上传带宽低于(MiB/24h),0=无限制(默认:%d) + Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) 通过Tor隐藏服务连接节点时 使用不同的SOCKS5代理 (默认: %s) @@ -3306,6 +3494,10 @@ (default: %s) (默认: %s) + + Always query for peer addresses via DNS lookup (default: %u) + 始终通过 DNS 查询节点地址 (默认: %u) + Error loading wallet.dat wallet.dat 钱包文件加载出错 diff --git a/src/qt/locale/bitcoin_zh_TW.ts b/src/qt/locale/bitcoin_zh_TW.ts index 67fb692ea1060..4026095928ab9 100644 --- a/src/qt/locale/bitcoin_zh_TW.ts +++ b/src/qt/locale/bitcoin_zh_TW.ts @@ -882,6 +882,34 @@ command-line options 命令列選項 + + UI Options: + 使用介面選項: + + + Choose data directory on startup (default: %u) + 啓動時選擇資料目錄(預設值: %u) + + + Set language, for example "de_DE" (default: system locale) + 設定語言,比如說 de_DE (預設值: 系統語系) + + + Start minimized + 啓動時縮到最小 + + + Set SSL root certificates for payment request (default: -system-) + 設定付款請求時所使用的 SSL 根憑證(預設值: 系統憑證庫) + + + Show splash screen on startup (default: %u) + 顯示啓動畫面(預設值: %u) + + + Reset all settings changes made over the GUI + 重置所有在使用界面更改的設定 + Intro @@ -1477,6 +1505,18 @@ Current number of blocks 目前區塊數 + + Memory Pool + 記憶體暫存池 + + + Current number of transactions + 目前交易數目 + + + Memory usage + 記憶體使用量 + Open the Bitcoin Core debug log file from the current data directory. This can take a few seconds for large log files. 從目前的資料目錄下開啓位元幣核心的除錯紀錄檔。當紀錄檔很大時,可能會花好幾秒的時間。 @@ -2101,6 +2141,10 @@ Pay only the required fee of %1 只付必要的手續費 %1 + + Estimated to begin confirmation within %n block(s). + 預計可在 %n 個區塊內開始確認。 + The recipient address is not valid. Please recheck. 收款位址無效。請再檢查看看。 @@ -3128,6 +3172,10 @@ Unsupported argument -tor found, use -onion. 找到不再支援的 -tor 參數,請改用 -onion 參數。 + + Use UPnP to map the listening port (default: %u) + 使用通用隨插即用 (UPnP) 協定來設定對應的服務連接埠(預設值: %u) + User Agent comment (%s) contains unsafe characters. 使用者代理註解(%s)中含有不安全的字元。 @@ -3230,7 +3278,7 @@ 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 - 在白名單中的節點不會因為偵測到阻斷服務攻擊而被停用。來自這些節點的交易也一定會被轉發,即使說交易本來就在記憶池裡了也一樣。適用於像是閘道伺服器。 + 在白名單中的節點不會因為偵測到阻斷服務攻擊(DoS)而被停用。來自這些節點的交易也一定會被轉發,即使說交易本來就在記憶池裡了也一樣。適用於像是閘道伺服器。 You need to rebuild the database using -reindex to go back to unpruned mode. This will redownload the entire blockchain @@ -3470,12 +3518,16 @@ Do not keep transactions in the mempool longer than <n> hours (default: %u) - 不要讓交易留在記憶體暫存池中超過 <n> 個小時(預設值: %u) + 不要讓交易留在記憶池中超過 <n> 個小時(預設值: %u) Error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. 讀取錢包檔 wallet.dat 時發生錯誤!所有的密鑰都正確讀取了,但是交易資料或位址簿資料可能會缺少或不正確。 + + Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s) + 當製造交易時,如果每千位元組(kB)的手續費比這個值(單位是 %s)低,就視為沒付手續費(預設值: %s) + How thorough the block verification of -checkblocks is (0-4, default: %u) 使用 -checkblocks 檢查區塊的仔細程度(0 到 4,預設值: %u) @@ -3492,6 +3544,10 @@ Output debugging information (default: %u, supplying <category> is optional) 輸出除錯資訊(預設值: %u, 不一定要指定 <category>) + + Support filtering of blocks and transaction with bloom filters (default: %u) + 支援用布倫過濾器來過濾區塊和交易(預設值: %u) + Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments. 網路版本字串的總長度(%i)超過最大長度(%i)了。請減少 uacomment 參數的數目或長度。 @@ -3508,6 +3564,10 @@ Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s) 使用另外的 SOCK5 代理伺服器,來透過 Tor 隱藏服務跟其他節點聯絡(預設值: %s) + + 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. This option can be specified multiple times + JSON-RPC 連線要用的使用者名稱和雜湊密碼。<userpw> 的格式是:<使用者名稱>:<調味值>$<雜湊值>。在 share/rpcuser 目錄下有一個示範的 python 程式。這個選項可以給很多次。 + (default: %s) (預設值: %s) diff --git a/src/qt/macdockiconhandler.h b/src/qt/macdockiconhandler.h index 8bd867c1034ba..1c28593d4af10 100644 --- a/src/qt/macdockiconhandler.h +++ b/src/qt/macdockiconhandler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/networkstyle.cpp b/src/qt/networkstyle.cpp index 4541c75886b6f..5f31f49372724 100644 --- a/src/qt/networkstyle.cpp +++ b/src/qt/networkstyle.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/notificator.h b/src/qt/notificator.h index f2a15e9c346bb..f92b791d4ac8d 100644 --- a/src/qt/notificator.h +++ b/src/qt/notificator.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/openuridialog.h b/src/qt/openuridialog.h index 28b8f56ca6f0f..e94593d5bb038 100644 --- a/src/qt/openuridialog.h +++ b/src/qt/openuridialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 647c860bdc7ec..ae1c05240ec9b 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 489e35da49248..e944fb9ee9b2a 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 3e5c6c72b1981..d091bb9e610aa 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index d5bddb1a94086..841711dd2d978 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index a56c80ac6326c..d577345e49097 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 4139eb35d369f..911443c76af19 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/paymentrequestplus.cpp b/src/qt/paymentrequestplus.cpp index 1000c143f3d40..20e1f79ffa233 100644 --- a/src/qt/paymentrequestplus.cpp +++ b/src/qt/paymentrequestplus.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/paymentrequestplus.h b/src/qt/paymentrequestplus.h index 8a7c4c06236dd..a73fe5f29dd60 100644 --- a/src/qt/paymentrequestplus.h +++ b/src/qt/paymentrequestplus.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin developers +// Copyright (c) 2011-2015 The Bitcoin developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 31a6d65a8dc49..c80aebb0098d8 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/paymentserver.h b/src/qt/paymentserver.h index fa120a435c15d..2d27ed078b537 100644 --- a/src/qt/paymentserver.h +++ b/src/qt/paymentserver.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 94837679d8ea3..84ad0052fdd90 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -147,7 +147,7 @@ int PeerTableModel::rowCount(const QModelIndex &parent) const int PeerTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); - return columns.length();; + return columns.length(); } QVariant PeerTableModel::data(const QModelIndex &index, int role) const diff --git a/src/qt/peertablemodel.h b/src/qt/peertablemodel.h index 5f149ea8735a8..a2aaaa5d24b94 100644 --- a/src/qt/peertablemodel.h +++ b/src/qt/peertablemodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/qvalidatedlineedit.cpp b/src/qt/qvalidatedlineedit.cpp index 5658a0bdcf6a1..baa2eb67f7621 100644 --- a/src/qt/qvalidatedlineedit.cpp +++ b/src/qt/qvalidatedlineedit.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/qvalidatedlineedit.h b/src/qt/qvalidatedlineedit.h index 8cb6a425fad51..66734cc9d4f97 100644 --- a/src/qt/qvalidatedlineedit.h +++ b/src/qt/qvalidatedlineedit.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/qvaluecombobox.cpp b/src/qt/qvaluecombobox.cpp index 800436661f231..146f3dd57850c 100644 --- a/src/qt/qvaluecombobox.cpp +++ b/src/qt/qvaluecombobox.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/qvaluecombobox.h b/src/qt/qvaluecombobox.h index 5b20e6a5a4ac5..f266302310f11 100644 --- a/src/qt/qvaluecombobox.h +++ b/src/qt/qvaluecombobox.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/receivecoinsdialog.cpp b/src/qt/receivecoinsdialog.cpp index 7fb68cc32a209..b1f82023bc7e6 100644 --- a/src/qt/receivecoinsdialog.cpp +++ b/src/qt/receivecoinsdialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/receivecoinsdialog.h b/src/qt/receivecoinsdialog.h index eaaf129a91d5d..543854a2f45e3 100644 --- a/src/qt/receivecoinsdialog.h +++ b/src/qt/receivecoinsdialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp index 0c4a20cf92c63..75108e0a10ce8 100644 --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -144,7 +144,7 @@ void ReceiveRequestDialog::update() html += "" + GUIUtil::HtmlEscape(uri) + "
"; html += ""+tr("Address")+": " + GUIUtil::HtmlEscape(info.address) + "
"; if(info.amount) - html += ""+tr("Amount")+": " + BitcoinUnits::formatWithUnit(model->getDisplayUnit(), info.amount) + "
"; + html += ""+tr("Amount")+": " + BitcoinUnits::formatHtmlWithUnit(model->getDisplayUnit(), info.amount) + "
"; if(!info.label.isEmpty()) html += ""+tr("Label")+": " + GUIUtil::HtmlEscape(info.label) + "
"; if(!info.message.isEmpty()) diff --git a/src/qt/receiverequestdialog.h b/src/qt/receiverequestdialog.h index 69f84ebbd7253..4cab4caff1ace 100644 --- a/src/qt/receiverequestdialog.h +++ b/src/qt/receiverequestdialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 5692a7aaef392..ef9422506a67d 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index 64faa72d455b9..f3cf03f4e3d1b 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 30e551de19790..4c869b9ac5cb3 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 4aebad480cbd8..8a48179c570ab 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index ec4e598bf9157..31c9028c4b5af 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -373,8 +373,6 @@ SendCoinsEntry *SendCoinsDialog::addEntry() connect(entry, SIGNAL(payAmountChanged()), this, SLOT(coinControlUpdateLabels())); connect(entry, SIGNAL(subtractFeeFromAmountChanged()), this, SLOT(coinControlUpdateLabels())); - updateTabsAndLabels(); - // Focus the field, so that entry can start immediately entry->clear(); entry->setFocus(); @@ -383,6 +381,8 @@ SendCoinsEntry *SendCoinsDialog::addEntry() QScrollBar* bar = ui->scrollArea->verticalScrollBar(); if(bar) bar->setSliderPosition(bar->maximum()); + + updateTabsAndLabels(); return entry; } @@ -808,7 +808,7 @@ void SendCoinsDialog::coinControlUpdateLabels() for(int i = 0; i < ui->entries->count(); ++i) { SendCoinsEntry *entry = qobject_cast(ui->entries->itemAt(i)->widget()); - if(entry) + if(entry && !entry->isHidden()) { SendCoinsRecipient rcp = entry->getValue(); CoinControlDialog::payAmounts.append(rcp.amount); diff --git a/src/qt/sendcoinsdialog.h b/src/qt/sendcoinsdialog.h index 391905ffcd7ac..ec171734faa20 100644 --- a/src/qt/sendcoinsdialog.h +++ b/src/qt/sendcoinsdialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index 4f4b5b70d50e6..d063f2c89104a 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/sendcoinsentry.h b/src/qt/sendcoinsentry.h index 107ab70158c50..a8be670c2aa03 100644 --- a/src/qt/sendcoinsentry.h +++ b/src/qt/sendcoinsentry.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/signverifymessagedialog.cpp b/src/qt/signverifymessagedialog.cpp index 96f50a26563ff..8e2e8a509876e 100644 --- a/src/qt/signverifymessagedialog.cpp +++ b/src/qt/signverifymessagedialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/signverifymessagedialog.h b/src/qt/signverifymessagedialog.h index d651d5049b503..d2e04cd4fe67f 100644 --- a/src/qt/signverifymessagedialog.h +++ b/src/qt/signverifymessagedialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index c15b64c327f76..9195b3b724128 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/splashscreen.h b/src/qt/splashscreen.h index 29d16d4eae2d6..821f39db1cf2f 100644 --- a/src/qt/splashscreen.h +++ b/src/qt/splashscreen.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/test/paymentrequestdata.h b/src/qt/test/paymentrequestdata.h index c548ffe429fda..74a2db8ea2952 100644 --- a/src/qt/test/paymentrequestdata.h +++ b/src/qt/test/paymentrequestdata.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index fa5696325d7a2..84ccfea730072 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/test/paymentservertests.h b/src/qt/test/paymentservertests.h index 71d61fcbe77c3..9ffcbb02ac952 100644 --- a/src/qt/test/paymentservertests.h +++ b/src/qt/test/paymentservertests.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index f91de2008c6fc..db193420bfb6e 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/test/uritests.h b/src/qt/test/uritests.h index 434169dcde0cf..49948427950d2 100644 --- a/src/qt/test/uritests.h +++ b/src/qt/test/uritests.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/trafficgraphwidget.cpp b/src/qt/trafficgraphwidget.cpp index 9b67445bc0f42..601d554c02520 100644 --- a/src/qt/trafficgraphwidget.cpp +++ b/src/qt/trafficgraphwidget.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/trafficgraphwidget.h b/src/qt/trafficgraphwidget.h index 6336a8d144646..00660574af8fa 100644 --- a/src/qt/trafficgraphwidget.h +++ b/src/qt/trafficgraphwidget.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 801c6c62d2b60..5cb4cd5af72b2 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -35,9 +35,11 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) { int nDepth = wtx.GetDepthInMainChain(); if (nDepth < 0) - return tr("conflicted"); + return tr("conflicted with a transaction with %1 confirmations").arg(-nDepth); else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0) return tr("%1/offline").arg(nDepth); + else if (nDepth == 0) + return tr("0/unconfirmed, %1").arg((wtx.InMempool() ? tr("in memory pool") : tr("not in memory pool"))); else if (nDepth < 6) return tr("%1/unconfirmed").arg(nDepth); else diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index d8623daf5dba0..5b16b108e66dd 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index e8ada9f762dfa..1647b2a6fe892 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index 601f893d47ecb..fe59a15f6a629 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 11e6d750ac320..28928d8212948 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index dde700c4d1498..cf2b8fbcd4f79 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 81b597e2ebb87..75ab9c4c3a5f6 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -84,7 +84,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) : strUsage += HelpMessageOpt("-min", tr("Start minimized").toStdString()); strUsage += HelpMessageOpt("-rootcertificates=", tr("Set SSL root certificates for payment request (default: -system-)").toStdString()); strUsage += HelpMessageOpt("-splash", strprintf(tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN)); - strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changes made over the GUI").toStdString()); + strUsage += HelpMessageOpt("-resetguisettings", tr("Reset all settings changed in the GUI").toStdString()); if (showDebug) { strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM)); } diff --git a/src/qt/utilitydialog.h b/src/qt/utilitydialog.h index 47282ae2d0504..843bd7f67bc06 100644 --- a/src/qt/utilitydialog.h +++ b/src/qt/utilitydialog.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp index ba8c28464d7f5..e4ca5e1831d15 100644 --- a/src/qt/walletframe.cpp +++ b/src/qt/walletframe.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h index 9a56e97f9cfe9..9a5bc273c2eae 100644 --- a/src/qt/walletframe.h +++ b/src/qt/walletframe.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 690ea0811e9a8..cf38c64eb0dee 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index a5e877d81f6aa..7a47eda86f70d 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp index 6a9b2d5bd3115..8c970ee8aabe9 100644 --- a/src/qt/walletmodeltransaction.cpp +++ b/src/qt/walletmodeltransaction.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletview.cpp b/src/qt/walletview.cpp index 77efdb5cdd108..6ce98ef160a5c 100644 --- a/src/qt/walletview.cpp +++ b/src/qt/walletview.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/qt/walletview.h b/src/qt/walletview.h index 2a6a6a2df2b93..dbb289f425466 100644 --- a/src/qt/walletview.h +++ b/src/qt/walletview.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/random.cpp b/src/random.cpp index 0ba0de908d8ff..6155c0d8cf23a 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rest.cpp b/src/rest.cpp index 2ad7bc1065d9b..ad884dac1c080 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index ee04636ce87d5..c317545ffc37e 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -197,7 +197,7 @@ UniValue mempoolToJSON(bool fVerbose = false) info.push_back(Pair("currentpriority", e.GetPriority(chainActive.Height()))); info.push_back(Pair("descendantcount", e.GetCountWithDescendants())); info.push_back(Pair("descendantsize", e.GetSizeWithDescendants())); - info.push_back(Pair("descendantfees", e.GetFeesWithDescendants())); + info.push_back(Pair("descendantfees", e.GetModFeesWithDescendants())); const CTransaction& tx = e.GetTx(); set setDepends; BOOST_FOREACH(const CTxIn& txin, tx.vin) @@ -255,7 +255,7 @@ UniValue getrawmempool(const UniValue& params, bool fHelp) " \"currentpriority\" : n, (numeric) transaction priority now\n" " \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n" " \"descendantsize\" : n, (numeric) size of in-mempool descendants (including this one)\n" - " \"descendantfees\" : n, (numeric) fees of in-mempool descendants (including this one)\n" + " \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one)\n" " \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n" " \"transactionid\", (string) parent transaction id\n" " ... ]\n" @@ -417,7 +417,7 @@ UniValue getblock(const UniValue& params, bool fHelp) if (!fVerbose) { - CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION); + CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); ssBlock << block; std::string strHex = HexStr(ssBlock.begin(), ssBlock.end()); return strHex; diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index cab5819017e9b..04715802372f5 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcclient.h b/src/rpcclient.h index 8937a56f035e3..ae015860b6714 100644 --- a/src/rpcclient.h +++ b/src/rpcclient.h @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index c8649ec27d759..acfe2cde39c10 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -163,7 +163,7 @@ UniValue generate(const UniValue& params, bool fHelp) CBlock *pblock = &pblocktemplate->block; { LOCK(cs_main); - IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce); + IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce, pblocktemplate->vchCoinbaseCommitment); } while (!CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus())) { // Yes, there is a chance every nonce could fail to satisfy the -regtest @@ -348,6 +348,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) " {\n" " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n" " \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n" + " \"withash\" : \"xxxx\", (string) witness hash encoded in little-endian hexadecimal\n" " \"depends\" : [ (array) array of numbers \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" @@ -528,7 +529,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) UniValue transactions(UniValue::VARR); map setTxIndex; int i = 0; - BOOST_FOREACH (const CTransaction& tx, pblock->vtx) { + BOOST_FOREACH (CTransaction& tx, pblock->vtx) { uint256 txHash = tx.GetHash(); setTxIndex[txHash] = i++; @@ -537,9 +538,16 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) UniValue entry(UniValue::VOBJ); - entry.push_back(Pair("data", EncodeHexTx(tx))); + entry.push_back(Pair("data", EncodeHexTx(tx, false))); + if (!tx.wit.IsNull()) { + CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); + tx.wit.vtxinwit.resize(tx.vin.size()); + ss << tx.wit; + entry.push_back(Pair("witdata", HexStr(ss.begin(), ss.end()))); + } entry.push_back(Pair("hash", txHash.GetHex())); + entry.push_back(Pair("withash", tx.GetWitnessHash().GetHex())); UniValue deps(UniValue::VARR); BOOST_FOREACH (const CTxIn &in, tx.vin) @@ -586,6 +594,9 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) result.push_back(Pair("curtime", pblock->GetBlockTime())); result.push_back(Pair("bits", strprintf("%08x", pblock->nBits))); result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); + if (!pblocktemplate->vchCoinbaseCommitment.empty()) { + result.push_back(Pair("_default_coinbase_commitment", HexStr(pblocktemplate->vchCoinbaseCommitment.begin(), pblocktemplate->vchCoinbaseCommitment.end()))); + } return result; } diff --git a/src/rpcmisc.cpp b/src/rpcmisc.cpp index 0c656d5cf1548..c38cbf6e44a4b 100644 --- a/src/rpcmisc.cpp +++ b/src/rpcmisc.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -312,6 +312,39 @@ UniValue createmultisig(const UniValue& params, bool fHelp) return result; } +UniValue createwitnessaddress(const UniValue& params, bool fHelp) +{ + if (fHelp || params.size() < 1 || params.size() > 1) + { + string msg = "createwitnessaddress \"script\"\n" + "\nCreates a witness address for a particular script.\n" + "It returns a json object with the address and witness script.\n" + + "\nArguments:\n" + "1. \"script\" (string, required) A hex encoded script\n" + + "\nResult:\n" + "{\n" + " \"address\":\"multisigaddress\", (string) The value of the new address (P2SH of witness script).\n" + " \"witnessScript\":\"script\" (string) The string value of the hex-encoded witness script.\n" + "}\n" + ; + throw runtime_error(msg); + } + + std::vector code = ParseHex(params[0].get_str()); + CScript script(code.begin(), code.end()); + CScript witscript = GetScriptForWitness(script); + CScriptID witscriptid(witscript); + CBitcoinAddress address(witscriptid); + + UniValue result(UniValue::VOBJ); + result.push_back(Pair("address", address.ToString())); + result.push_back(Pair("witnessScript", HexStr(witscript.begin(), witscript.end()))); + + return result; +} + UniValue verifymessage(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 3) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 2578848891501..b61e7c5f1389e 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -111,6 +111,14 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp) " n, (numeric) The heights of blocks we're currently asking from this peer\n" " ...\n" " ]\n" + " \"bytessent_per_msg\": {\n" + " \"addr\": n, (numeric) The total bytes sent aggregated by message type\n" + " ...\n" + " }\n" + " \"bytesrecv_per_msg\": {\n" + " \"addr\": n, (numeric) The total bytes received aggregated by message type\n" + " ...\n" + " }\n" " }\n" " ,...\n" "]\n" @@ -165,6 +173,20 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp) } obj.push_back(Pair("whitelisted", stats.fWhitelisted)); + UniValue sendPerMsgCmd(UniValue::VOBJ); + BOOST_FOREACH(const mapMsgCmdSize::value_type &i, stats.mapSendBytesPerMsgCmd) { + if (i.second > 0) + sendPerMsgCmd.push_back(Pair(i.first, i.second)); + } + obj.push_back(Pair("bytessent_per_msg", sendPerMsgCmd)); + + UniValue recvPerMsgCmd(UniValue::VOBJ); + BOOST_FOREACH(const mapMsgCmdSize::value_type &i, stats.mapRecvBytesPerMsgCmd) { + if (i.second > 0) + recvPerMsgCmd.push_back(Pair(i.first, i.second)); + } + obj.push_back(Pair("bytesrecv_per_msg", recvPerMsgCmd)); + ret.push_back(obj); } diff --git a/src/rpcprotocol.cpp b/src/rpcprotocol.cpp index d83cd87f9400a..b7605545d8c4b 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpcprotocol.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcprotocol.h b/src/rpcprotocol.h index 9cf1ab6d99ce9..55d0aac68b785 100644 --- a/src/rpcprotocol.h +++ b/src/rpcprotocol.h @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 1f2d77aef0fa2..cabd7dcab9368 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -95,6 +95,12 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry) } entry.push_back(Pair("vout", vout)); + if (!tx.wit.IsNull()) { + CDataStream ssWit(SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); + ssWit << tx.wit; + entry.push_back(Pair("witness", HexStr(ssWit.begin(), ssWit.end()))); + } + if (!hashBlock.IsNull()) { entry.push_back(Pair("blockhash", hashBlock.GetHex())); BlockMap::iterator mi = mapBlockIndex.find(hashBlock); @@ -353,7 +359,6 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp) + HelpExampleRpc("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"data\\\":\\\"00010203\\\"}\"") ); - LOCK(cs_main); RPCTypeCheck(params, boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)(UniValue::VNUM), true); if (params[0].isNull() || params[1].isNull()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, arguments 1 and 2 must be non-null"); @@ -559,7 +564,8 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) " \"txid\":\"id\", (string, required) The transaction id\n" " \"vout\":n, (numeric, required) The output number\n" " \"scriptPubKey\": \"hex\", (string, required) script key\n" - " \"redeemScript\": \"hex\" (string, required for P2SH) redeem script\n" + " \"redeemScript\": \"hex\", (string, required for P2SH) redeem script\n" + " \"amount\": value (numeric, required) The amount spent\n" " }\n" " ,...\n" " ]\n" @@ -605,7 +611,7 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)(UniValue::VARR)(UniValue::VARR)(UniValue::VSTR), true); vector txData(ParseHexV(params[0], "argument 1")); - CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION); + CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_WITNESS); vector txVariants; while (!ssData.empty()) { try { @@ -697,7 +703,10 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) if ((unsigned int)nOut >= coins->vout.size()) coins->vout.resize(nOut+1); coins->vout[nOut].scriptPubKey = scriptPubKey; - coins->vout[nOut].nValue = 0; // we don't know the actual output value + coins->vout[nOut].nValue = 0; + if (prevOut.exists("amount")) { + coins->vout[nOut].nValue = AmountFromValue(find_value(prevOut, "amount")); + } } // if redeemScript given and not using the local wallet (private keys @@ -752,18 +761,22 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) continue; } const CScript& prevPubKey = coins->vout[txin.prevout.n].scriptPubKey; + const CAmount& amount = coins->vout[txin.prevout.n].nValue; - txin.scriptSig.clear(); + SignatureData sigdata; // Only sign SIGHASH_SINGLE if there's a corresponding output: if (!fHashSingle || (i < mergedTx.vout.size())) - SignSignature(keystore, prevPubKey, mergedTx, i, nHashType); + ProduceSignature(MutableTransactionSignatureCreator(&keystore, &mergedTx, i, amount, nHashType), prevPubKey, sigdata); // ... and merge in other signatures: BOOST_FOREACH(const CMutableTransaction& txv, txVariants) { - txin.scriptSig = CombineSignatures(prevPubKey, mergedTx, i, txin.scriptSig, txv.vin[i].scriptSig); + sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i)); } + + UpdateTransaction(mergedTx, i, sigdata); + ScriptError serror = SCRIPT_ERR_OK; - if (!VerifyScript(txin.scriptSig, prevPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i), &serror)) { + if (!VerifyScript(txin.scriptSig, prevPubKey, mergedTx.wit.vtxinwit.size() > i ? &mergedTx.wit.vtxinwit[i].scriptWitness : NULL, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i, amount), &serror)) { TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror)); } } diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 83d2c2d5037fc..433a4f4ba5521 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -315,6 +315,7 @@ static const CRPCCommand vRPCCommands[] = /* Utility functions */ { "util", "createmultisig", &createmultisig, true }, + { "util", "createwitnessaddress", &createwitnessaddress, true }, { "util", "validateaddress", &validateaddress, true }, /* uses wallet if enabled */ { "util", "verifymessage", &verifymessage, true }, { "util", "estimatefee", &estimatefee, true }, @@ -333,6 +334,7 @@ static const CRPCCommand vRPCCommands[] = #ifdef ENABLE_WALLET /* Wallet */ { "wallet", "addmultisigaddress", &addmultisigaddress, true }, + { "wallet", "addwitnessaddress", &addwitnessaddress, true }, { "wallet", "backupwallet", &backupwallet, true }, { "wallet", "dumpprivkey", &dumpprivkey, true }, { "wallet", "dumpwallet", &dumpwallet, true }, diff --git a/src/rpcserver.h b/src/rpcserver.h index fc88f82be8b56..f2c7e24ec083a 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -213,7 +213,9 @@ extern UniValue movecmd(const UniValue& params, bool fHelp); extern UniValue sendfrom(const UniValue& params, bool fHelp); extern UniValue sendmany(const UniValue& params, bool fHelp); extern UniValue addmultisigaddress(const UniValue& params, bool fHelp); +extern UniValue addwitnessaddress(const UniValue& params, bool fHelp); extern UniValue createmultisig(const UniValue& params, bool fHelp); +extern UniValue createwitnessaddress(const UniValue& params, bool fHelp); extern UniValue listreceivedbyaddress(const UniValue& params, bool fHelp); extern UniValue listreceivedbyaccount(const UniValue& params, bool fHelp); extern UniValue listtransactions(const UniValue& params, bool fHelp); diff --git a/src/script/bitcoinconsensus.cpp b/src/script/bitcoinconsensus.cpp index 79504f6ad3692..7c0cc29017981 100644 --- a/src/script/bitcoinconsensus.cpp +++ b/src/script/bitcoinconsensus.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -69,7 +69,7 @@ struct ECCryptoClosure ECCryptoClosure instance_of_eccryptoclosure; } -int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, +int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, uint64_t amount, const unsigned char *txTo , unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err) { @@ -85,7 +85,8 @@ int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned i // Regardless of the verification result, the tx did not error. set_error(err, bitcoinconsensus_ERR_OK); - return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), flags, TransactionSignatureChecker(&tx, nIn), NULL); + CAmount am(amount); + return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), nIn < tx.wit.vtxinwit.size() ? &tx.wit.vtxinwit[nIn].scriptWitness : NULL, flags, TransactionSignatureChecker(&tx, nIn, am), NULL); } catch (const std::exception&) { return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing } diff --git a/src/script/bitcoinconsensus.h b/src/script/bitcoinconsensus.h index a48ff1e18d3a4..40b396a880bbd 100644 --- a/src/script/bitcoinconsensus.h +++ b/src/script/bitcoinconsensus.h @@ -1,11 +1,13 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_BITCOINCONSENSUS_H #define BITCOIN_BITCOINCONSENSUS_H +#include + #if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" #if defined(_WIN32) @@ -54,7 +56,7 @@ enum /// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under /// the additional constraints specified by flags. /// If not NULL, err will contain an error/success code for the operation -EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, +EXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, uint64_t amount, const unsigned char *txTo , unsigned int txToLen, unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err); diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index 57e0edc4b4f24..776f49274cebe 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -226,7 +226,7 @@ bool static CheckMinimalPush(const valtype& data, opcodetype opcode) { return true; } -bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) +bool EvalScript(vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, int sigversion, ScriptError* serror) { static const CScriptNum bnZero(0); static const CScriptNum bnOne(1); @@ -835,7 +835,7 @@ bool EvalScript(vector >& stack, const CScript& script, un //serror is set return false; } - bool fSuccess = checker.CheckSig(vchSig, vchPubKey, scriptCode); + bool fSuccess = checker.CheckSig(vchSig, vchPubKey, scriptCode, sigversion); popstack(stack); popstack(stack); @@ -903,7 +903,7 @@ bool EvalScript(vector >& stack, const CScript& script, un } // Check signature - bool fOk = checker.CheckSig(vchSig, vchPubKey, scriptCode); + bool fOk = checker.CheckSig(vchSig, vchPubKey, scriptCode, sigversion); if (fOk) { isig++; @@ -1066,8 +1066,64 @@ class CTransactionSignatureSerializer { } // anon namespace -uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType) +uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, const CAmount& amount, int sigversion) { + if (sigversion == 1) { + uint256 hashPrevouts; + uint256 hashSequence; + uint256 hashOutputs; + + if (!(nHashType & SIGHASH_ANYONECANPAY)) { + CHashWriter ss(SER_GETHASH, 0); + for (unsigned int n = 0; n < txTo.vin.size(); n++) { + ss << txTo.vin[n].prevout; + } + hashPrevouts = ss.GetHash(); // TODO: cache this value for all signatures in a transaction + } + + if (!(nHashType & SIGHASH_ANYONECANPAY) && (nHashType & 0x1f) != SIGHASH_SINGLE && (nHashType & 0x1f) != SIGHASH_NONE) { + CHashWriter ss(SER_GETHASH, 0); + for (unsigned int n = 0; n < txTo.vin.size(); n++) { + ss << txTo.vin[n].nSequence; + } + hashSequence = ss.GetHash(); // TODO: cache this value for all signatures in a transaction + } + + if ((nHashType & 0x1f) != SIGHASH_SINGLE && (nHashType & 0x1f) != SIGHASH_NONE) { + CHashWriter ss(SER_GETHASH, 0); + for (unsigned int n = 0; n < txTo.vout.size(); n++) { + ss << txTo.vout[n]; + } + hashOutputs = ss.GetHash(); // TODO: cache this value for all signatures in a transaction + } else if ((nHashType & 0x1f) == SIGHASH_SINGLE && nIn < txTo.vout.size()) { + CHashWriter ss(SER_GETHASH, 0); + ss << txTo.vout[nIn]; + hashOutputs = ss.GetHash(); + } + + CHashWriter ss(SER_GETHASH, 0); + // Version + ss << txTo.nVersion; + // Input prevouts/nSequence (none/all, depending on flags) + ss << hashPrevouts; + ss << hashSequence; + // The input being signed (replacing the scriptSig with scriptCode + amount) + // The prevout may already be contained in hashPrevout, and the nSequence + // may already be contain in hashSequence. + ss << txTo.vin[nIn].prevout; + ss << static_cast(scriptCode); + ss << amount; + ss << txTo.vin[nIn].nSequence; + // Outputs (none/one/all, depending on flags) + ss << hashOutputs; + // Locktime + ss << txTo.nLockTime; + // Sighash type + ss << nHashType; + + return ss.GetHash(); + } + static const uint256 one(uint256S("0000000000000000000000000000000000000000000000000000000000000001")); if (nIn >= txTo.vin.size()) { // nIn out of range @@ -1096,7 +1152,7 @@ bool TransactionSignatureChecker::VerifySignature(const std::vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode) const +bool TransactionSignatureChecker::CheckSig(const vector& vchSigIn, const vector& vchPubKey, const CScript& scriptCode, int sigversion) const { CPubKey pubkey(vchPubKey); if (!pubkey.IsValid()) @@ -1109,7 +1165,7 @@ bool TransactionSignatureChecker::CheckSig(const vector& vchSigIn int nHashType = vchSig.back(); vchSig.pop_back(); - uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType); + uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion); if (!VerifySignature(vchSig, pubkey, sighash)) return false; @@ -1153,9 +1209,56 @@ bool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) con return true; } +static bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion, const std::vector& program, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) +{ + vector > stack; + CScript scriptPubKey; + + if (witversion == 0) { + // Version 0 segregated witness program: CScript inside the program, inputs in witness + scriptPubKey = CScript(program.begin(), program.end()); + stack = witness.stack; + } else if (witversion == 1) { + // Version 1 segregated witness program: SHA256(CScript) inside the program, CScript + inputs in witness + if (program.size() != 32) { + return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH); + } + if (witness.stack.size() == 0) { + return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY); + } + scriptPubKey = CScript(witness.stack.back().begin(), witness.stack.back().end()); + stack = std::vector >(witness.stack.begin(), witness.stack.end() - 1); + uint256 hashScriptPubKey; + CSHA256().Write(&scriptPubKey[0], scriptPubKey.size()).Finalize(hashScriptPubKey.begin()); + if (memcmp(hashScriptPubKey.begin(), &program[0], 32)) { + return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH); + } + } else if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM) { + return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM); + } else { + // Higher version witness scripts return true for future softfork compatibility + return set_success(serror); + } + + if (!EvalScript(stack, scriptPubKey, flags, checker, 1, serror)) { + return false; + } + // Scripts inside witness implicitly require cleanstack behaviour + if (stack.size() != 1) + return set_error(serror, SCRIPT_ERR_EVAL_FALSE); + if (!CastToBool(stack.back())) + return set_error(serror, SCRIPT_ERR_EVAL_FALSE); + return true; +} -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror) { + static const CScriptWitness emptyWitness; + if (witness == NULL) { + witness = &emptyWitness; + } + bool hadWitness = false; + set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR); if ((flags & SCRIPT_VERIFY_SIGPUSHONLY) != 0 && !scriptSig.IsPushOnly()) { @@ -1163,12 +1266,12 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigne } vector > stack, stackCopy; - if (!EvalScript(stack, scriptSig, flags, checker, serror)) + if (!EvalScript(stack, scriptSig, flags, checker, 0, serror)) // serror is set return false; if (flags & SCRIPT_VERIFY_P2SH) stackCopy = stack; - if (!EvalScript(stack, scriptPubKey, flags, checker, serror)) + if (!EvalScript(stack, scriptPubKey, flags, checker, 0, serror)) // serror is set return false; if (stack.empty()) @@ -1176,6 +1279,25 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigne if (CastToBool(stack.back()) == false) return set_error(serror, SCRIPT_ERR_EVAL_FALSE); + // Bare witness programs + int witnessversion; + std::vector witnessprogram; + if (flags & SCRIPT_VERIFY_WITNESS) { + if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) { + hadWitness = true; + if (scriptSig.size() != 0) { + // The scriptSig must be _exactly_ CScript(), otherwise we reintroduce malleability. + return set_error(serror, SCRIPT_ERR_WITNESS_MALLEATED); + } + if (!VerifyWitnessProgram(*witness, witnessversion, witnessprogram, flags, checker, serror)) { + return false; + } + // Bypass the cleanstack check at the end. The actual stack is obviously not clean + // for witness programs. + stack.resize(1); + } + } + // Additional validation for spend-to-script-hash transactions: if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash()) { @@ -1195,26 +1317,102 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigne CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end()); popstack(stack); - if (!EvalScript(stack, pubKey2, flags, checker, serror)) + if (!EvalScript(stack, pubKey2, flags, checker, 0, serror)) // serror is set return false; if (stack.empty()) return set_error(serror, SCRIPT_ERR_EVAL_FALSE); if (!CastToBool(stack.back())) return set_error(serror, SCRIPT_ERR_EVAL_FALSE); + + // P2SH witness program + if (flags & SCRIPT_VERIFY_WITNESS) { + if (pubKey2.IsWitnessProgram(witnessversion, witnessprogram)) { + hadWitness = true; + if (scriptSig != CScript() << std::vector(pubKey2.begin(), pubKey2.end())) { + // The scriptSig must be _exactly_ a single push of the redeemScript. Otherwise we + // reintroduce malleability. + return set_error(serror, SCRIPT_ERR_WITNESS_MALLEATED_P2SH); + } + if (!VerifyWitnessProgram(*witness, witnessversion, witnessprogram, flags, checker, serror)) { + return false; + } + // Bypass the cleanstack check at the end. The actual stack is obviously not clean + // for witness programs. + stack.resize(1); + } + } } // The CLEANSTACK check is only performed after potential P2SH evaluation, // as the non-P2SH evaluation of a P2SH script will obviously not result in - // a clean stack (the P2SH inputs remain). + // a clean stack (the P2SH inputs remain). The same holds for witness evaluation. if ((flags & SCRIPT_VERIFY_CLEANSTACK) != 0) { // Disallow CLEANSTACK without P2SH, as otherwise a switch CLEANSTACK->P2SH+CLEANSTACK // would be possible, which is not a softfork (and P2SH should be one). assert((flags & SCRIPT_VERIFY_P2SH) != 0); + assert((flags & SCRIPT_VERIFY_WITNESS) != 0); if (stack.size() != 1) { return set_error(serror, SCRIPT_ERR_CLEANSTACK); } } + if (flags & SCRIPT_VERIFY_WITNESS) { + // We can't check for correct unexpected witness data if P2SH was off, so require + // that WITNESS implies P2SH. Otherwise, going from WITNESS->P2SH+WITNESS would be + // possible, which is not a softfork. + assert((flags & SCRIPT_VERIFY_P2SH) != 0); + if (!hadWitness && !witness->IsNull()) { + return set_error(serror, SCRIPT_ERR_WITNESS_UNEXPECTED); + } + } + return set_success(serror); } + +size_t static WitnessSigOps(int witversion, const std::vector& witprogram, const CScriptWitness& witness, int flags) +{ + if (witversion == 0) { + CScript script(witprogram.begin(), witprogram.end()); + return script.GetSigOpCount(true); + } + + if (witversion == 1 && witness.stack.size() > 0) { + CScript subscript(witness.stack.back().begin(), witness.stack.back().end()); + return subscript.GetSigOpCount(true); + } + + // Future flags may be implemented here. + return 0; +} + +size_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags) +{ + static const CScriptWitness witnessEmpty; + + if ((flags & SCRIPT_VERIFY_WITNESS) == 0) { + return 0; + } + assert((flags & SCRIPT_VERIFY_P2SH) != 0); + + int witnessversion; + std::vector witnessprogram; + if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) { + return WitnessSigOps(witnessversion, witnessprogram, witness ? *witness : witnessEmpty, flags); + } + + if (scriptPubKey.IsPayToScriptHash() && scriptSig.IsPushOnly()) { + CScript::const_iterator pc = scriptSig.begin(); + vector data; + while (pc < scriptSig.end()) { + opcodetype opcode; + scriptSig.GetOp(pc, opcode, data); + } + CScript subscript(data.begin(), data.end()); + if (subscript.IsWitnessProgram(witnessversion, witnessprogram)) { + return WitnessSigOps(witnessversion, witnessprogram, witness ? *witness : witnessEmpty, flags); + } + } + + return 0; +} diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 213e8c765163a..6b72804408631 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -74,23 +74,31 @@ enum // "At least one stack element must remain, and when interpreted as a boolean, it must be true" to // "Exactly one stack element must remain, and when interpreted as a boolean, it must be true". // (softfork safe, BIP62 rule 6) - // Note: CLEANSTACK should never be used without P2SH. + // Note: CLEANSTACK should never be used without P2SH or WITNESS. SCRIPT_VERIFY_CLEANSTACK = (1U << 8), // Verify CHECKLOCKTIMEVERIFY // // See BIP65 for details. SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), + + // Support segregated witness + // + SCRIPT_VERIFY_WITNESS = (1U << 10), + + // Making v2-v16 witness program non-standard + // + SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM = (1U << 11), }; bool CheckSignatureEncoding(const std::vector &vchSig, unsigned int flags, ScriptError* serror); -uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); +uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, const CAmount& amount, int sigversion); class BaseSignatureChecker { public: - virtual bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const + virtual bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int sigversion) const { return false; } @@ -108,13 +116,14 @@ class TransactionSignatureChecker : public BaseSignatureChecker private: const CTransaction* txTo; unsigned int nIn; + const CAmount amount; protected: virtual bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; public: - TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn) : txTo(txToIn), nIn(nInIn) {} - bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const; + TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn) : txTo(txToIn), nIn(nInIn), amount(amountIn) {} + bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int sigversion) const; bool CheckLockTime(const CScriptNum& nLockTime) const; }; @@ -124,10 +133,12 @@ class MutableTransactionSignatureChecker : public TransactionSignatureChecker const CTransaction txTo; public: - MutableTransactionSignatureChecker(const CMutableTransaction* txToIn, unsigned int nInIn) : TransactionSignatureChecker(&txTo, nInIn), txTo(*txToIn) {} + MutableTransactionSignatureChecker(const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amount) : TransactionSignatureChecker(&txTo, nInIn, amount), txTo(*txToIn) {} }; -bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* error = NULL); -bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* error = NULL); +bool EvalScript(std::vector >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, int sigversion, ScriptError* error = NULL); +bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror = NULL); + +size_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags); #endif // BITCOIN_SCRIPT_INTERPRETER_H diff --git a/src/script/script.cpp b/src/script/script.cpp index 9c77ed9fc19db..cabee7dc979c7 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -131,7 +131,7 @@ const char* GetOpName(opcodetype opcode) // expanson case OP_NOP1 : return "OP_NOP1"; - case OP_NOP2 : return "OP_NOP2"; + case OP_CHECKLOCKTIMEVERIFY : return "OP_CHECKLOCKTIMEVERIFY"; case OP_NOP3 : return "OP_NOP3"; case OP_NOP4 : return "OP_NOP4"; case OP_NOP5 : return "OP_NOP5"; @@ -210,6 +210,24 @@ bool CScript::IsPayToScriptHash() const (*this)[22] == OP_EQUAL); } +// A witness program is any valid CScript that consists of a 1-byte push opcode +// followed by a data push between 2 and 32 bytes. +bool CScript::IsWitnessProgram(int& version, std::vector& program) const +{ + if (this->size() < 4 || this->size() > 34) { + return false; + } + if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) { + return false; + } + if ((size_t)((*this)[1] + 2) == this->size()) { + version = DecodeOP_N((opcodetype)(*this)[0]); + program = std::vector(this->begin() + 2, this->end()); + return true; + } + return false; +} + bool CScript::IsPushOnly(const_iterator pc) const { while (pc < end()) @@ -231,3 +249,15 @@ bool CScript::IsPushOnly() const { return this->IsPushOnly(begin()); } + +std::string CScriptWitness::ToString() const +{ + std::string ret = "CScriptWitness("; + for (unsigned int i = 0; i < stack.size(); i++) { + if (i) { + ret += ", "; + } + ret += HexStr(stack[i]); + } + return ret + ")"; +} diff --git a/src/script/script.h b/src/script/script.h index 3650957fc9bff..d516a78c9a845 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -162,8 +162,8 @@ enum opcodetype // expansion OP_NOP1 = 0xb0, - OP_NOP2 = 0xb1, - OP_CHECKLOCKTIMEVERIFY = OP_NOP2, + OP_CHECKLOCKTIMEVERIFY = 0xb1, + OP_NOP2 = OP_CHECKLOCKTIMEVERIFY, OP_NOP3 = 0xb2, OP_NOP4 = 0xb3, OP_NOP5 = 0xb4, @@ -597,6 +597,7 @@ class CScript : public CScriptBase unsigned int GetSigOpCount(const CScript& scriptSig) const; bool IsPayToScriptHash() const; + bool IsWitnessProgram(int& version, std::vector& program) const; /** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */ bool IsPushOnly(const_iterator pc) const; @@ -619,6 +620,18 @@ class CScript : public CScriptBase } }; +struct CScriptWitness +{ + std::vector > stack; + + // Some compilers complain without a default constructor + CScriptWitness() { } + + bool IsNull() const { return stack.empty(); } + + std::string ToString() const; +}; + class CReserveScript { public: diff --git a/src/script/script_error.cpp b/src/script/script_error.cpp index f1aa1fb408ae5..1128e63eb15ab 100644 --- a/src/script/script_error.cpp +++ b/src/script/script_error.cpp @@ -67,6 +67,20 @@ const char* ScriptErrorString(const ScriptError serror) return "NOPx reserved for soft-fork upgrades"; case SCRIPT_ERR_PUBKEYTYPE: return "Public key is neither compressed or uncompressed"; + case SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH: + return "Witness program has incorrect length"; + case SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY: + return "Witness program was passed an empty witness"; + case SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH: + return "Witness program hash mismatch"; + case SCRIPT_ERR_WITNESS_MALLEATED: + return "Witness requires empty scriptSig"; + case SCRIPT_ERR_WITNESS_MALLEATED_P2SH: + return "Witness requires only-redeemscript scriptSig"; + case SCRIPT_ERR_WITNESS_UNEXPECTED: + return "Witness provided for non-witness script"; + case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM: + return "Witness program version reserved for soft-fork upgrades"; case SCRIPT_ERR_UNKNOWN_ERROR: case SCRIPT_ERR_ERROR_COUNT: default: break; diff --git a/src/script/script_error.h b/src/script/script_error.h index bb10b8a2932a5..1c7a7d99c22e2 100644 --- a/src/script/script_error.h +++ b/src/script/script_error.h @@ -52,6 +52,15 @@ typedef enum ScriptError_t /* softfork safeness */ SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS, + /* segregated witness */ + SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH, + SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY, + SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH, + SCRIPT_ERR_WITNESS_MALLEATED, + SCRIPT_ERR_WITNESS_MALLEATED_P2SH, + SCRIPT_ERR_WITNESS_UNEXPECTED, + SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM, + SCRIPT_ERR_ERROR_COUNT } ScriptError; diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index eee96e7c2d1d2..bdc0bfdc1c0f2 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/script/sigcache.h b/src/script/sigcache.h index 22699725607c9..050bf8cc42290 100644 --- a/src/script/sigcache.h +++ b/src/script/sigcache.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -22,7 +22,7 @@ class CachingTransactionSignatureChecker : public TransactionSignatureChecker bool store; public: - CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, bool storeIn=true) : TransactionSignatureChecker(txToIn, nInIn), store(storeIn) {} + CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amount, bool storeIn) : TransactionSignatureChecker(txToIn, nInIn, amount), store(storeIn) {} bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; }; diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 90f557fc60872..f351d5061ecd9 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -18,31 +18,31 @@ using namespace std; typedef std::vector valtype; -TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), checker(txTo, nIn) {} +TransactionSignatureCreator::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) {} -bool TransactionSignatureCreator::CreateSig(std::vector& vchSig, const CKeyID& address, const CScript& scriptCode) const +bool TransactionSignatureCreator::CreateSig(std::vector& vchSig, const CKeyID& address, const CScript& scriptCode, int sigversion) const { CKey key; if (!keystore->GetKey(address, key)) return false; - uint256 hash = SignatureHash(scriptCode, *txTo, nIn, nHashType); + uint256 hash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion); if (!key.Sign(hash, vchSig)) return false; vchSig.push_back((unsigned char)nHashType); return true; } -static bool Sign1(const CKeyID& address, const BaseSignatureCreator& creator, const CScript& scriptCode, CScript& scriptSigRet) +static bool Sign1(const CKeyID& address, const BaseSignatureCreator& creator, const CScript& scriptCode, std::vector& ret, int sigversion) { vector vchSig; - if (!creator.CreateSig(vchSig, address, scriptCode)) + if (!creator.CreateSig(vchSig, address, scriptCode, sigversion)) return false; - scriptSigRet << vchSig; + ret.push_back(vchSig); return true; } -static bool SignN(const vector& multisigdata, const BaseSignatureCreator& creator, const CScript& scriptCode, CScript& scriptSigRet) +static bool SignN(const vector& multisigdata, const BaseSignatureCreator& creator, const CScript& scriptCode, std::vector& ret, int sigversion) { int nSigned = 0; int nRequired = multisigdata.front()[0]; @@ -50,7 +50,7 @@ static bool SignN(const vector& multisigdata, const BaseSignatureCreato { const valtype& pubkey = multisigdata[i]; CKeyID keyID = CPubKey(pubkey).GetID(); - if (Sign1(keyID, creator, scriptCode, scriptSigRet)) + if (Sign1(keyID, creator, scriptCode, ret, sigversion)) ++nSigned; } return nSigned==nRequired; @@ -63,9 +63,11 @@ static bool SignN(const vector& multisigdata, const BaseSignatureCreato * Returns false if scriptPubKey could not be completely satisfied. */ static bool SignStep(const BaseSignatureCreator& creator, const CScript& scriptPubKey, - CScript& scriptSigRet, txnouttype& whichTypeRet) + std::vector& ret, txnouttype& whichTypeRet, int sigversion) { - scriptSigRet.clear(); + CScript scriptRet; + uint160 h160; + ret.clear(); vector vSolutions; if (!Solver(scriptPubKey, whichTypeRet, vSolutions)) @@ -79,62 +81,141 @@ static bool SignStep(const BaseSignatureCreator& creator, const CScript& scriptP return false; case TX_PUBKEY: keyID = CPubKey(vSolutions[0]).GetID(); - return Sign1(keyID, creator, scriptPubKey, scriptSigRet); + return Sign1(keyID, creator, scriptPubKey, ret, sigversion); case TX_PUBKEYHASH: keyID = CKeyID(uint160(vSolutions[0])); - if (!Sign1(keyID, creator, scriptPubKey, scriptSigRet)) + if (!Sign1(keyID, creator, scriptPubKey, ret, sigversion)) return false; else { CPubKey vch; creator.KeyStore().GetPubKey(keyID, vch); - scriptSigRet << ToByteVector(vch); + ret.push_back(ToByteVector(vch)); } return true; case TX_SCRIPTHASH: - return creator.KeyStore().GetCScript(uint160(vSolutions[0]), scriptSigRet); + if (creator.KeyStore().GetCScript(uint160(vSolutions[0]), scriptRet)) { + ret.push_back(std::vector(scriptRet.begin(), scriptRet.end())); + return true; + } + return false; case TX_MULTISIG: - scriptSigRet << OP_0; // workaround CHECKMULTISIG bug - return (SignN(vSolutions, creator, scriptPubKey, scriptSigRet)); + ret.push_back(valtype()); // workaround CHECKMULTISIG bug + return (SignN(vSolutions, creator, scriptPubKey, ret, sigversion)); + + case TX_WITNESS_V0: + ret.push_back(vSolutions[0]); + return true; + + case TX_WITNESS_V1: + CRIPEMD160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(h160.begin()); + if (creator.KeyStore().GetCScript(h160, scriptRet)) { + ret.push_back(std::vector(scriptRet.begin(), scriptRet.end())); + return true; + } + return false; + + default: + return false; } - return false; } -bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& fromPubKey, CScript& scriptSig) +static CScript PushAll(const vector& values) +{ + CScript result; + BOOST_FOREACH(const valtype& v, values) { + if (v.size() == 0) { + result << OP_0; + } else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) { + result << CScript::EncodeOP_N(v[0]); + } else { + result << v; + } + } + return result; +} + +bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& fromPubKey, SignatureData& sigdata) { + CScript script = fromPubKey; + bool solved = true; + std::vector result; txnouttype whichType; - if (!SignStep(creator, fromPubKey, scriptSig, whichType)) - return false; + solved = SignStep(creator, script, result, whichType, 0); + bool P2SH = false; + CScript subscript; + sigdata.scriptWitness.stack.clear(); - if (whichType == TX_SCRIPTHASH) + if (solved && whichType == TX_SCRIPTHASH) { - // Solver returns the subscript that need to be evaluated; + // Solver returns the subscript that needs to be evaluated; // the final scriptSig is the signatures from that // and then the serialized subscript: - CScript subscript = scriptSig; + script = subscript = CScript(result[0].begin(), result[0].end()); + solved = solved && SignStep(creator, script, result, whichType, 0) && whichType != TX_SCRIPTHASH; + P2SH = true; + } + if (solved && whichType == TX_WITNESS_V0) + { + CScript witnessscript(result[0].begin(), result[0].end()); txnouttype subType; - bool fSolved = - SignStep(creator, subscript, scriptSig, subType) && subType != TX_SCRIPTHASH; - // Append serialized subscript whether or not it is completely signed: - scriptSig << valtype(subscript.begin(), subscript.end()); - if (!fSolved) return false; + solved = solved && SignStep(creator, witnessscript, result, subType, 1) && subType != TX_SCRIPTHASH && subType != TX_WITNESS_V0 && subType != TX_WITNESS_V1; + sigdata.scriptWitness.stack = result; + result.clear(); } + else if (solved && whichType == TX_WITNESS_V1) + { + CScript witnessscript(result[0].begin(), result[0].end()); + txnouttype subType; + solved = solved && SignStep(creator, witnessscript, result, subType, 1) && subType != TX_SCRIPTHASH && subType != TX_WITNESS_V0 && subType != TX_WITNESS_V1; + result.push_back(std::vector(witnessscript.begin(), witnessscript.end())); + sigdata.scriptWitness.stack = result; + result.clear(); + } + + if (P2SH) { + result.push_back(std::vector(subscript.begin(), subscript.end())); + } + sigdata.scriptSig = PushAll(result); // Test solution - return VerifyScript(scriptSig, fromPubKey, STANDARD_SCRIPT_VERIFY_FLAGS, creator.Checker()); + return solved && VerifyScript(sigdata.scriptSig, fromPubKey, &sigdata.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, creator.Checker()); } -bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType) +SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn) +{ + SignatureData data; + assert(tx.vin.size() > nIn); + data.scriptSig = tx.vin[nIn].scriptSig; + if (tx.wit.vtxinwit.size() > nIn) { + data.scriptWitness = tx.wit.vtxinwit[nIn].scriptWitness; + } + return data; +} + +void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data) +{ + assert(tx.vin.size() > nIn); + tx.vin[nIn].scriptSig = data.scriptSig; + if (!data.scriptWitness.IsNull() || tx.wit.vtxinwit.size() > nIn) { + tx.wit.vtxinwit.resize(tx.vin.size()); + tx.wit.vtxinwit[nIn].scriptWitness = data.scriptWitness; + } +} + +bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType) { assert(nIn < txTo.vin.size()); - CTxIn& txin = txTo.vin[nIn]; CTransaction txToConst(txTo); - TransactionSignatureCreator creator(&keystore, &txToConst, nIn, nHashType); + TransactionSignatureCreator creator(&keystore, &txToConst, nIn, amount, nHashType); - return ProduceSignature(creator, fromPubKey, txin.scriptSig); + SignatureData sigdata; + bool ret = ProduceSignature(creator, fromPubKey, sigdata); + UpdateTransaction(txTo, nIn, sigdata); + return ret; } bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType) @@ -144,20 +225,12 @@ bool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutab assert(txin.prevout.n < txFrom.vout.size()); const CTxOut& txout = txFrom.vout[txin.prevout.n]; - return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, nHashType); + return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, txout.nValue, nHashType); } -static CScript PushAll(const vector& values) -{ - CScript result; - BOOST_FOREACH(const valtype& v, values) - result << v; - return result; -} - -static CScript CombineMultisig(const CScript& scriptPubKey, const BaseSignatureChecker& checker, +static vector CombineMultisig(const CScript& scriptPubKey, const BaseSignatureChecker& checker, const vector& vSolutions, - const vector& sigs1, const vector& sigs2) + const vector& sigs1, const vector& sigs2, int sigversion) { // Combine all the signatures we've got: set allsigs; @@ -185,7 +258,7 @@ static CScript CombineMultisig(const CScript& scriptPubKey, const BaseSignatureC if (sigs.count(pubkey)) continue; // Already got a sig for this pubkey - if (checker.CheckSig(sig, pubkey, scriptPubKey)) + if (checker.CheckSig(sig, pubkey, scriptPubKey, sigversion)) { sigs[pubkey] = sig; break; @@ -194,87 +267,142 @@ static CScript CombineMultisig(const CScript& scriptPubKey, const BaseSignatureC } // Now build a merged CScript: unsigned int nSigsHave = 0; - CScript result; result << OP_0; // pop-one-too-many workaround + std::vector result; result.push_back(valtype()); // pop-one-too-many workaround for (unsigned int i = 0; i < nPubKeys && nSigsHave < nSigsRequired; i++) { if (sigs.count(vSolutions[i+1])) { - result << sigs[vSolutions[i+1]]; + result.push_back(sigs[vSolutions[i+1]]); ++nSigsHave; } } // Fill any missing with OP_0: for (unsigned int i = nSigsHave; i < nSigsRequired; i++) - result << OP_0; + result.push_back(valtype()); return result; } -static CScript CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, +namespace +{ +struct Stacks +{ + std::vector script; + std::vector witness; + + Stacks() {} + explicit Stacks(const std::vector& scriptSigStack_) : script(scriptSigStack_), witness() {} + explicit Stacks(const SignatureData& data) : witness(data.scriptWitness.stack) { + EvalScript(script, data.scriptSig, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker(), 0); + } + + SignatureData Output() const { + SignatureData result; + result.scriptSig = PushAll(script); + result.scriptWitness.stack = witness; + return result; + } +}; +} + +static Stacks CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, const txnouttype txType, const vector& vSolutions, - vector& sigs1, vector& sigs2) + Stacks sigs1, Stacks sigs2, int sigversion) { switch (txType) { case TX_NONSTANDARD: case TX_NULL_DATA: // Don't know anything about this, assume bigger one is correct: - if (sigs1.size() >= sigs2.size()) - return PushAll(sigs1); - return PushAll(sigs2); + if (sigs1.script.size() >= sigs2.script.size()) + return sigs1; + return sigs2; case TX_PUBKEY: case TX_PUBKEYHASH: // Signatures are bigger than placeholders or empty scripts: - if (sigs1.empty() || sigs1[0].empty()) - return PushAll(sigs2); - return PushAll(sigs1); + if (sigs1.script.empty() || sigs1.script[0].empty()) + return sigs2; + return sigs1; case TX_SCRIPTHASH: - if (sigs1.empty() || sigs1.back().empty()) - return PushAll(sigs2); - else if (sigs2.empty() || sigs2.back().empty()) - return PushAll(sigs1); + if (sigs1.script.empty() || sigs1.script.back().empty()) + return sigs2; + else if (sigs2.script.empty() || sigs2.script.back().empty()) + return sigs1; else { // Recur to combine: - valtype spk = sigs1.back(); + valtype spk = sigs1.script.back(); CScript pubKey2(spk.begin(), spk.end()); txnouttype txType2; vector > vSolutions2; Solver(pubKey2, txType2, vSolutions2); - sigs1.pop_back(); - sigs2.pop_back(); - CScript result = CombineSignatures(pubKey2, checker, txType2, vSolutions2, sigs1, sigs2); - result << spk; + sigs1.script.pop_back(); + sigs2.script.pop_back(); + Stacks result = CombineSignatures(pubKey2, checker, txType2, vSolutions2, sigs1, sigs2, sigversion); + result.script.push_back(spk); return result; } case TX_MULTISIG: - return CombineMultisig(scriptPubKey, checker, vSolutions, sigs1, sigs2); + return Stacks(CombineMultisig(scriptPubKey, checker, vSolutions, sigs1.script, sigs2.script, sigversion)); + case TX_WITNESS_V0: + if (sigs1.witness.empty()) + return sigs2; + else if (sigs2.witness.empty()) + return sigs1; + else + { + // Recur to combine: + CScript pubKey2(vSolutions[0].begin(), vSolutions[0].end()); + txnouttype txType2; + vector vSolutions2; + Solver(pubKey2, txType2, vSolutions2); + sigs1.script = sigs1.witness; + sigs1.witness.clear(); + sigs2.script = sigs2.witness; + sigs2.witness.clear(); + Stacks result = CombineSignatures(pubKey2, checker, txType2, vSolutions2, sigs1, sigs2, 1); + result.witness = result.script; + result.script.clear(); + return result; + } + case TX_WITNESS_V1: + if (sigs1.witness.empty() || sigs1.witness.back().empty()) + return sigs2; + else if (sigs2.witness.empty() || sigs2.witness.back().empty()) + return sigs1; + else + { + // Recur to combine: + CScript pubKey2(sigs1.witness.back().begin(), sigs1.witness.back().end()); + txnouttype txType2; + vector vSolutions2; + Solver(pubKey2, txType2, vSolutions2); + sigs1.witness.pop_back(); + sigs1.script = sigs1.witness; + sigs1.witness.clear(); + sigs2.witness.pop_back(); + sigs2.script = sigs2.witness; + sigs2.witness.clear(); + Stacks result = CombineSignatures(pubKey2, checker, txType2, vSolutions2, sigs1, sigs2, 1); + result.witness = result.script; + result.script.clear(); + result.witness.push_back(valtype(pubKey2.begin(), pubKey2.end())); + return result; + } + default: + return Stacks(); } - - return CScript(); } -CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, - const CScript& scriptSig1, const CScript& scriptSig2) -{ - TransactionSignatureChecker checker(&txTo, nIn); - return CombineSignatures(scriptPubKey, checker, scriptSig1, scriptSig2); -} - -CScript CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, - const CScript& scriptSig1, const CScript& scriptSig2) +SignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, + const SignatureData& scriptSig1, const SignatureData& scriptSig2) { txnouttype txType; vector > vSolutions; Solver(scriptPubKey, txType, vSolutions); - vector stack1; - EvalScript(stack1, scriptSig1, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker()); - vector stack2; - EvalScript(stack2, scriptSig2, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker()); - - return CombineSignatures(scriptPubKey, checker, txType, vSolutions, stack1, stack2); + return CombineSignatures(scriptPubKey, checker, txType, vSolutions, Stacks(scriptSig1), Stacks(scriptSig2), 0).Output(); } namespace { @@ -284,7 +412,7 @@ class DummySignatureChecker : public BaseSignatureChecker public: DummySignatureChecker() {} - bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode) const + bool CheckSig(const std::vector& scriptSig, const std::vector& vchPubKey, const CScript& scriptCode, int sigversion) const { return true; } @@ -297,7 +425,7 @@ const BaseSignatureChecker& DummySignatureCreator::Checker() const return dummyChecker; } -bool DummySignatureCreator::CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const +bool DummySignatureCreator::CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode, int sigversion) const { // Create a dummy signature that is a valid DER-encoding vchSig.assign(72, '\000'); diff --git a/src/script/sign.h b/src/script/sign.h index 13f45007dda57..04ea8b0150fc1 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -27,7 +27,7 @@ class BaseSignatureCreator { virtual const BaseSignatureChecker& Checker() const =0; /** Create a singular (non-script) signature. */ - virtual bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const =0; + virtual bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode, int sigversion) const =0; }; /** A signature creator for transactions. */ @@ -35,12 +35,20 @@ class TransactionSignatureCreator : public BaseSignatureCreator { const CTransaction* txTo; unsigned int nIn; int nHashType; + CAmount amount; const TransactionSignatureChecker checker; public: - TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, int nHashTypeIn=SIGHASH_ALL); + TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, const CAmount& amount, int nHashTypeIn); const BaseSignatureChecker& Checker() const { return checker; } - bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const; + bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode, int sigversion) const; +}; + +class MutableTransactionSignatureCreator : public TransactionSignatureCreator { + CTransaction tx; + +public: + MutableTransactionSignatureCreator(const CKeyStore* keystoreIn, const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amount, int nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amount, nHashTypeIn), tx(*txToIn) {} }; /** A signature creator that just produces 72-byte empty signatyres. */ @@ -48,20 +56,29 @@ class DummySignatureCreator : public BaseSignatureCreator { public: DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {} const BaseSignatureChecker& Checker() const; - bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode) const; + bool CreateSig(std::vector& vchSig, const CKeyID& keyid, const CScript& scriptCode, int sigversion) const; +}; + +struct SignatureData { + CScript scriptSig; + CScriptWitness scriptWitness; + + SignatureData() {} + explicit SignatureData(const CScript& script) : scriptSig(script) {} }; /** Produce a script signature using a generic signature creator. */ -bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& scriptPubKey, CScript& scriptSig); +bool ProduceSignature(const BaseSignatureCreator& creator, const CScript& scriptPubKey, SignatureData& sigdata); /** Produce a script signature for a transaction. */ -bool SignSignature(const CKeyStore& keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); +bool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType=SIGHASH_ALL); bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType=SIGHASH_ALL); /** Combine two script signatures using a generic signature checker, intelligently, possibly with OP_0 placeholders. */ -CScript CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, const CScript& scriptSig1, const CScript& scriptSig2); +SignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, const SignatureData& scriptSig1, const SignatureData& scriptSig2); -/** Combine two script signatures on transactions. */ -CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); +/** Extract signature data from a transaction, and insert it. */ +SignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn); +void UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data); #endif // BITCOIN_SCRIPT_SIGN_H diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 4863b96391963..64f322ea39a74 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -31,6 +31,8 @@ const char* GetTxnOutputType(txnouttype t) case TX_SCRIPTHASH: return "scripthash"; case TX_MULTISIG: return "multisig"; case TX_NULL_DATA: return "nulldata"; + case TX_WITNESS_V0: return "witness_v0"; + case TX_WITNESS_V1: return "witness_v1"; } return NULL; } @@ -66,6 +68,22 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector witnessprogram; + if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) { + if (witnessversion == 0) { + typeRet = TX_WITNESS_V0; + vSolutionsRet.push_back(witnessprogram); + return true; + } + if (witnessversion == 1 && witnessprogram.size() == 32) { + typeRet = TX_WITNESS_V1; + vSolutionsRet.push_back(witnessprogram); + return true; + } + return false; + } + // Provably prunable, data-carrying output // // So long as script passes the IsUnspendable() test and all but the first @@ -178,6 +196,10 @@ int ScriptSigArgsExpected(txnouttype t, const std::vector& keys) script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG; return script; } + +CScript GetScriptForWitness(const CScript& redeemscript) +{ + opcodetype witnessversion = OP_0; + std::vector witnessprogram; + + if (redeemscript.size() >= 1 && redeemscript.size() <= 32) { + witnessprogram = std::vector(redeemscript.begin(), redeemscript.end()); + } else { + witnessversion = OP_1; + uint256 hash; + CSHA256().Write(&redeemscript[0], redeemscript.size()).Finalize(hash.begin()); + witnessprogram = ToByteVector(hash); + } + + CScript script; + script << witnessversion << witnessprogram; + int v; + assert(script.IsWitnessProgram(v, witnessprogram)); + return script; +} diff --git a/src/script/standard.h b/src/script/standard.h index 2b9fbe78dd1d4..0a4155bc44797 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -51,6 +51,8 @@ enum txnouttype TX_SCRIPTHASH, TX_MULTISIG, TX_NULL_DATA, + TX_WITNESS_V0, + TX_WITNESS_V1, }; class CNoDestination { @@ -78,5 +80,6 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std:: CScript GetScriptForDestination(const CTxDestination& dest); CScript GetScriptForRawPubKey(const CPubKey& pubkey); CScript GetScriptForMultisig(int nRequired, const std::vector& keys); +CScript GetScriptForWitness(const CScript& redeemscript); #endif // BITCOIN_SCRIPT_STANDARD_H diff --git a/src/serialize.h b/src/serialize.h index 5fe7fc1f3583c..5c2db9d332ce3 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/streams.h b/src/streams.h index 8610e4d18e612..e5b0f06cde475 100644 --- a/src/streams.h +++ b/src/streams.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -22,6 +22,39 @@ #include #include +template +class OverrideStream +{ + Stream* stream; +public: + const int nType; + const int nVersion; + + OverrideStream(Stream* stream_, int nType_, int nVersion_) : stream(stream_), nType(nType_), nVersion(nVersion_) {} + + template + OverrideStream& operator<<(const T& obj) + { + // Serialize to this stream + ::Serialize(*this->stream, obj, nType, nVersion); + return (*this); + } + + template + OverrideStream& operator>>(T& obj) + { + // Unserialize from this stream + ::Unserialize(*this->stream, obj, nType, nVersion); + return (*this); + } +}; + +template +OverrideStream WithOrVersion(S* s, int nVersionFlag) +{ + return OverrideStream(s, s->GetType(), s->GetVersion() | nVersionFlag); +} + /** Double ended buffer combining vector and stream-like interfaces. * * >> and << read and write unformatted data using the above serialization templates. diff --git a/src/support/allocators/secure.h b/src/support/allocators/secure.h index 5e7bb66ea2141..1ec40fe83003f 100644 --- a/src/support/allocators/secure.h +++ b/src/support/allocators/secure.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/support/allocators/zeroafterfree.h b/src/support/allocators/zeroafterfree.h index 41e23392e80ba..28a940ad1b339 100644 --- a/src/support/allocators/zeroafterfree.h +++ b/src/support/allocators/zeroafterfree.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/support/pagelocker.cpp b/src/support/pagelocker.cpp index 440e0a5193a8c..7cea2d88c55c6 100644 --- a/src/support/pagelocker.cpp +++ b/src/support/pagelocker.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/support/pagelocker.h b/src/support/pagelocker.h index 88b95cce73d9c..6b3979e5513b1 100644 --- a/src/support/pagelocker.h +++ b/src/support/pagelocker.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/sync.cpp b/src/sync.cpp index 1837e8d53ddb1..8df8ae43f4357 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2012 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/sync.h b/src/sync.h index 68a9443084a5e..34dd8c228eb76 100644 --- a/src/sync.h +++ b/src/sync.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/Checkpoints_tests.cpp b/src/test/Checkpoints_tests.cpp index 0a23c430ed164..1b7d368e13ec0 100644 --- a/src/test/Checkpoints_tests.cpp +++ b/src/test/Checkpoints_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index da296a046144e..95342498fa782 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(DoS_banning) CNode dummyNode1(INVALID_SOCKET, addr1, "", true); dummyNode1.nVersion = 1; Misbehaving(dummyNode1.GetId(), 100); // Should get banned - SendMessages(&dummyNode1, false); + SendMessages(&dummyNode1); BOOST_CHECK(CNode::IsBanned(addr1)); BOOST_CHECK(!CNode::IsBanned(ip(0xa0b0c001|0x0000ff00))); // Different IP, not banned @@ -57,11 +57,11 @@ BOOST_AUTO_TEST_CASE(DoS_banning) CNode dummyNode2(INVALID_SOCKET, addr2, "", true); dummyNode2.nVersion = 1; Misbehaving(dummyNode2.GetId(), 50); - SendMessages(&dummyNode2, false); + SendMessages(&dummyNode2); BOOST_CHECK(!CNode::IsBanned(addr2)); // 2 not banned yet... BOOST_CHECK(CNode::IsBanned(addr1)); // ... but 1 still should be Misbehaving(dummyNode2.GetId(), 50); - SendMessages(&dummyNode2, false); + SendMessages(&dummyNode2); BOOST_CHECK(CNode::IsBanned(addr2)); } @@ -73,13 +73,13 @@ BOOST_AUTO_TEST_CASE(DoS_banscore) CNode dummyNode1(INVALID_SOCKET, addr1, "", true); dummyNode1.nVersion = 1; Misbehaving(dummyNode1.GetId(), 100); - SendMessages(&dummyNode1, false); + SendMessages(&dummyNode1); BOOST_CHECK(!CNode::IsBanned(addr1)); Misbehaving(dummyNode1.GetId(), 10); - SendMessages(&dummyNode1, false); + SendMessages(&dummyNode1); BOOST_CHECK(!CNode::IsBanned(addr1)); Misbehaving(dummyNode1.GetId(), 1); - SendMessages(&dummyNode1, false); + SendMessages(&dummyNode1); BOOST_CHECK(CNode::IsBanned(addr1)); mapArgs.erase("-banscore"); } @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE(DoS_bantime) dummyNode.nVersion = 1; Misbehaving(dummyNode.GetId(), 100); - SendMessages(&dummyNode, false); + SendMessages(&dummyNode); BOOST_CHECK(CNode::IsBanned(addr)); SetMockTime(nStartTime+60*60); diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp index 4a294c6712d78..dad191c68435e 100644 --- a/src/test/accounting_tests.cpp +++ b/src/test/accounting_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/addrman_tests.cpp b/src/test/addrman_tests.cpp index cfcdd9abb2724..a1e6a204fcc18 100644 --- a/src/test/addrman_tests.cpp +++ b/src/test/addrman_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "addrman.h" diff --git a/src/test/alert_tests.cpp b/src/test/alert_tests.cpp index 468eda1c9bbee..0895ef3326a17 100644 --- a/src/test/alert_tests.cpp +++ b/src/test/alert_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/allocator_tests.cpp b/src/test/allocator_tests.cpp index 2108efece5137..613f6c12d76f8 100644 --- a/src/test/allocator_tests.cpp +++ b/src/test/allocator_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/arith_uint256_tests.cpp b/src/test/arith_uint256_tests.cpp index 17d6bed6d2fb9..53ab7e95ee0cd 100644 --- a/src/test/arith_uint256_tests.cpp +++ b/src/test/arith_uint256_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/base32_tests.cpp b/src/test/base32_tests.cpp index 8ec8861425987..6422b3a88f9ab 100644 --- a/src/test/base32_tests.cpp +++ b/src/test/base32_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/base58_tests.cpp b/src/test/base58_tests.cpp index 9845df697f996..e5a2e28b2e9de 100644 --- a/src/test/base58_tests.cpp +++ b/src/test/base58_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/base64_tests.cpp b/src/test/base64_tests.cpp index 54c081b0ef9f8..ccad94d946d99 100644 --- a/src/test/base64_tests.cpp +++ b/src/test/base64_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/bip32_tests.cpp b/src/test/bip32_tests.cpp index 69084213a2d44..ce29e692db2bd 100644 --- a/src/test/bip32_tests.cpp +++ b/src/test/bip32_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 6b30d6aa8ae7a..98f9de7673831 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/checkblock_tests.cpp b/src/test/checkblock_tests.cpp index f7e24706170d4..c945a95adc404 100644 --- a/src/test/checkblock_tests.cpp +++ b/src/test/checkblock_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2014 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 9489a19f63041..3fe536f91aec8 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/compress_tests.cpp b/src/test/compress_tests.cpp index 376ae9368107a..35e4458bba730 100644 --- a/src/test/compress_tests.cpp +++ b/src/test/compress_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/crypto_tests.cpp b/src/test/crypto_tests.cpp index aeb2a5caa322c..0b46d718d1d13 100644 --- a/src/test/crypto_tests.cpp +++ b/src/test/crypto_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 7afa2abf49b16..7ce7e0879cb65 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -160,12 +160,12 @@ ["2 2 LSHIFT", "8 EQUAL", "P2SH,STRICTENC", "disabled"], ["2 1 RSHIFT", "1 EQUAL", "P2SH,STRICTENC", "disabled"], -["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL", "P2SH,STRICTENC"], -["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL", "P2SH,STRICTENC"], +["1","NOP1 CHECKLOCKTIMEVERIFY NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL", "P2SH,STRICTENC"], +["'NOP_1_to_10' NOP1 CHECKLOCKTIMEVERIFY NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_11' EQUAL", "P2SH,STRICTENC"], ["Ensure 100% coverage of discouraged NOPS"], ["1", "NOP1", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], -["1", "NOP2", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], +["1", "CHECKLOCKTIMEVERIFY", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], ["1", "NOP3", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], ["1", "NOP4", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], ["1", "NOP5", "P2SH,DISCOURAGE_UPGRADABLE_NOPS"], diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index a4e15faeaf0e4..e5f0d17b0473e 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -232,8 +232,8 @@ ["'abcdefghijklmnopqrstuvwxyz'", "HASH256 0x4c 0x20 0xca139bc10c2f660da42666f72e89a225936fc60f193c161124a672050c434671 EQUAL", "P2SH,STRICTENC"], -["1","NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL", "P2SH,STRICTENC"], -["'NOP_1_to_10' NOP1 NOP2 NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL", "P2SH,STRICTENC"], +["1","NOP1 CHECKLOCKTIMEVERIFY NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL", "P2SH,STRICTENC"], +["'NOP_1_to_10' NOP1 CHECKLOCKTIMEVERIFY NOP3 NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10","'NOP_1_to_10' EQUAL", "P2SH,STRICTENC"], ["1", "NOP", "P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS", "Discourage NOPx flag allows OP_NOP"], @@ -442,7 +442,7 @@ ["NOP", "CODESEPARATOR 1", "P2SH,STRICTENC"], ["NOP", "NOP1 1", "P2SH,STRICTENC"], -["NOP", "NOP2 1", "P2SH,STRICTENC"], +["NOP", "CHECKLOCKTIMEVERIFY 1", "P2SH,STRICTENC"], ["NOP", "NOP3 1", "P2SH,STRICTENC"], ["NOP", "NOP4 1", "P2SH,STRICTENC"], ["NOP", "NOP5 1", "P2SH,STRICTENC"], diff --git a/src/test/data/tx_invalid.json b/src/test/data/tx_invalid.json index cc059e814fdf1..b36c99c180a32 100644 --- a/src/test/data/tx_invalid.json +++ b/src/test/data/tx_invalid.json @@ -30,10 +30,6 @@ "010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000", "P2SH"], ["Tests for CheckTransaction()"], -["No inputs"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL"]], -"0100000000010000000000000000015100000000", "P2SH"], - ["No outputs"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "HASH160 0x14 0x05ab9e14d983742513f0f451e105ffb4198d1dd4 EQUAL"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022100f16703104aab4e4088317c862daec83440242411b039d14280e03dd33b487ab802201318a7be236672c5c56083eb7a5a195bc57a40af7923ff8545016cd3b571e2a601232103c40e5d339df3f30bf753e7e04450ae4ef76c9e45587d1d993bdc4cd06f0651c7acffffffff0000000000", "P2SH"], @@ -127,66 +123,66 @@ ["CHECKLOCKTIMEVERIFY tests"], ["By-height locks, with argument just beyond tx nLockTime"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000fe64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], ["By-time locks, with argument just beyond tx nLockTime (but within numerical boundaries)"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000001 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000001 CHECKLOCKTIMEVERIFY 1"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "P2SH,CHECKLOCKTIMEVERIFY"], ["Argument missing"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000001b1010000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Argument negative with by-blockheight nLockTime=0"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Argument negative with by-blocktime nLockTime=500,000,000"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "-1 CHECKLOCKTIMEVERIFY 1"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000004005194b1010000000100000000000000000002000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Input locked"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1ffffffff0100000000000000000002000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Another input being unlocked isn't sufficient; the CHECKLOCKTIMEVERIFY-using input must be unlocked"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"] , +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"] , ["0000000000000000000000000000000000000000000000000000000000000200", 1, "1"]], "010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00020000000000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Argument/tx height/time mismatch, both versions"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], [[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b100000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 CHECKLOCKTIMEVERIFY 1"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], ["Argument 2^32 with nLockTime=2^32-1"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967296 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967296 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"], ["Same, but with nLockTime=2^31-1"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483648 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffff7f", "P2SH,CHECKLOCKTIMEVERIFY"], ["6 byte non-minimally-encoded arguments are invalid even if their contents are valid"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x06 0x000000000000 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x06 0x000000000000 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Failure due to failing CHECKLOCKTIMEVERIFY in scriptSig"], diff --git a/src/test/data/tx_valid.json b/src/test/data/tx_valid.json index 0dfef73ae5e2b..76d29bcf268fa 100644 --- a/src/test/data/tx_valid.json +++ b/src/test/data/tx_valid.json @@ -190,35 +190,35 @@ ["CHECKLOCKTIMEVERIFY tests"], ["By-height locks, with argument == 0 and == tx nLockTime"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], ["By-time locks, with argument just beyond tx nLockTime (but within numerical boundaries)"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY 1"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "4294967295 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "500000000 CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff", "P2SH,CHECKLOCKTIMEVERIFY"], ["Any non-maxint nSequence is fine"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["The argument can be calculated rather than created directly by a PUSHDATA"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 1ADD NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "499999999 1ADD CHECKLOCKTIMEVERIFY 1"]], "01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d", "P2SH,CHECKLOCKTIMEVERIFY"], ["Perhaps even by an ADD producing a 5-byte result that is out of bounds for other opcodes"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 2147483647 ADD NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "2147483647 2147483647 ADD CHECKLOCKTIMEVERIFY 1"]], "0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff", "P2SH,CHECKLOCKTIMEVERIFY"], ["5 byte non-minimally-encoded arguments are valid"], -[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x05 0x0000000000 NOP2 1"]], +[[["0000000000000000000000000000000000000000000000000000000000000100", 0, "0x05 0x0000000000 CHECKLOCKTIMEVERIFY 1"]], "010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000", "P2SH,CHECKLOCKTIMEVERIFY"], ["Valid CHECKLOCKTIMEVERIFY in scriptSig"], diff --git a/src/test/dbwrapper_tests.cpp b/src/test/dbwrapper_tests.cpp index 8b6b0697ab1d0..e399315870e79 100644 --- a/src/test/dbwrapper_tests.cpp +++ b/src/test/dbwrapper_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/getarg_tests.cpp b/src/test/getarg_tests.cpp index eb61a2884d9f9..9f59de3ef5f9d 100644 --- a/src/test/getarg_tests.cpp +++ b/src/test/getarg_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/hash_tests.cpp b/src/test/hash_tests.cpp index e5d2e5a439efc..35079d1614345 100644 --- a/src/test/hash_tests.cpp +++ b/src/test/hash_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/key_tests.cpp b/src/test/key_tests.cpp index 13ca9494690ca..4978c9513030a 100644 --- a/src/test/key_tests.cpp +++ b/src/test/key_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/main_tests.cpp b/src/test/main_tests.cpp index 2b92d239e90ec..dbfbdd934f827 100644 --- a/src/test/main_tests.cpp +++ b/src/test/main_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp index e9f7378f747d1..4dae407793f9c 100644 --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -363,12 +363,12 @@ BOOST_AUTO_TEST_CASE(MempoolSizeLimitTest) BOOST_CHECK(pool.exists(tx2.GetHash())); BOOST_CHECK(pool.exists(tx3.GetHash())); - pool.TrimToSize(::GetSerializeSize(CTransaction(tx1), SER_NETWORK, PROTOCOL_VERSION)); // mempool is limited to tx1's size in memory usage, so nothing fits + pool.TrimToSize(GetVirtualTransactionSize(tx1)); // mempool is limited to tx1's size in memory usage, so nothing fits BOOST_CHECK(!pool.exists(tx1.GetHash())); BOOST_CHECK(!pool.exists(tx2.GetHash())); BOOST_CHECK(!pool.exists(tx3.GetHash())); - CFeeRate maxFeeRateRemoved(25000, ::GetSerializeSize(CTransaction(tx3), SER_NETWORK, PROTOCOL_VERSION) + ::GetSerializeSize(CTransaction(tx2), SER_NETWORK, PROTOCOL_VERSION)); + CFeeRate maxFeeRateRemoved(25000, GetVirtualTransactionSize(tx3) + GetVirtualTransactionSize(tx2)); BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + 1000); CMutableTransaction tx4 = CMutableTransaction(); diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 19ddb5b79c5e2..71b52409b33d8 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/mruset_tests.cpp b/src/test/mruset_tests.cpp deleted file mode 100644 index 2b68f8899eea8..0000000000000 --- a/src/test/mruset_tests.cpp +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "mruset.h" - -#include "random.h" -#include "util.h" -#include "test/test_bitcoin.h" - -#include - -#include - -#define NUM_TESTS 16 -#define MAX_SIZE 100 - -using namespace std; - -BOOST_FIXTURE_TEST_SUITE(mruset_tests, BasicTestingSetup) - -BOOST_AUTO_TEST_CASE(mruset_test) -{ - // The mruset being tested. - mruset mru(5000); - - // Run the test 10 times. - for (int test = 0; test < 10; test++) { - // Reset mru. - mru.clear(); - - // A deque + set to simulate the mruset. - std::deque rep; - std::set all; - - // Insert 10000 random integers below 15000. - for (int j=0; j<10000; j++) { - int add = GetRandInt(15000); - mru.insert(add); - - // Add the number to rep/all as well. - if (all.count(add) == 0) { - all.insert(add); - rep.push_back(add); - if (all.size() == 5001) { - all.erase(rep.front()); - rep.pop_front(); - } - } - - // Do a full comparison between mru and the simulated mru every 1000 and every 5001 elements. - if (j % 1000 == 0 || j % 5001 == 0) { - mruset mru2 = mru; // Also try making a copy - - // Check that all elements that should be in there, are in there. - BOOST_FOREACH(int x, rep) { - BOOST_CHECK(mru.count(x)); - BOOST_CHECK(mru2.count(x)); - } - - // Check that all elements that are in there, should be in there. - BOOST_FOREACH(int x, mru) { - BOOST_CHECK(all.count(x)); - } - - // Check that all elements that are in there, should be in there. - BOOST_FOREACH(int x, mru2) { - BOOST_CHECK(all.count(x)); - } - - for (int t = 0; t < 10; t++) { - int r = GetRandInt(15000); - BOOST_CHECK(all.count(r) == mru.count(r)); - BOOST_CHECK(all.count(r) == mru2.count(r)); - } - } - } - } -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index b65c299adcbaa..9105a78f092c3 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -28,7 +28,7 @@ BOOST_FIXTURE_TEST_SUITE(multisig_tests, BasicTestingSetup) CScript sign_multisig(CScript scriptPubKey, vector keys, CTransaction transaction, int whichIn) { - uint256 hash = SignatureHash(scriptPubKey, transaction, whichIn, SIGHASH_ALL); + uint256 hash = SignatureHash(scriptPubKey, transaction, whichIn, SIGHASH_ALL, 0, 0); CScript result; result << OP_0; // CHECKMULTISIG bug workaround @@ -48,6 +48,7 @@ BOOST_AUTO_TEST_CASE(multisig_verify) ScriptError err; CKey key[4]; + CAmount amount = 0; for (int i = 0; i < 4; i++) key[i].MakeNewKey(true); @@ -83,20 +84,20 @@ BOOST_AUTO_TEST_CASE(multisig_verify) keys.assign(1,key[0]); keys.push_back(key[1]); s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK(VerifyScript(s, a_and_b, flags, MutableTransactionSignatureChecker(&txTo[0], 0), &err)); + BOOST_CHECK(VerifyScript(s, a_and_b, NULL, flags, MutableTransactionSignatureChecker(&txTo[0], 0, amount), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); for (int i = 0; i < 4; i++) { keys.assign(1,key[i]); s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, MutableTransactionSignatureChecker(&txTo[0], 0), &err), strprintf("a&b 1: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, NULL, flags, MutableTransactionSignatureChecker(&txTo[0], 0, amount), &err), strprintf("a&b 1: %d", i)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString(err)); keys.assign(1,key[1]); keys.push_back(key[i]); s = sign_multisig(a_and_b, keys, txTo[0], 0); - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, flags, MutableTransactionSignatureChecker(&txTo[0], 0), &err), strprintf("a&b 2: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, NULL, flags, MutableTransactionSignatureChecker(&txTo[0], 0, amount), &err), strprintf("a&b 2: %d", i)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); } @@ -107,18 +108,18 @@ BOOST_AUTO_TEST_CASE(multisig_verify) s = sign_multisig(a_or_b, keys, txTo[1], 0); if (i == 0 || i == 1) { - BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, flags, MutableTransactionSignatureChecker(&txTo[1], 0), &err), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, NULL, flags, MutableTransactionSignatureChecker(&txTo[1], 0, amount), &err), strprintf("a|b: %d", i)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } else { - BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, flags, MutableTransactionSignatureChecker(&txTo[1], 0), &err), strprintf("a|b: %d", i)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, NULL, flags, MutableTransactionSignatureChecker(&txTo[1], 0, amount), &err), strprintf("a|b: %d", i)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); } } s.clear(); s << OP_0 << OP_1; - BOOST_CHECK(!VerifyScript(s, a_or_b, flags, MutableTransactionSignatureChecker(&txTo[1], 0), &err)); + BOOST_CHECK(!VerifyScript(s, a_or_b, NULL, flags, MutableTransactionSignatureChecker(&txTo[1], 0, amount), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_SIG_DER, ScriptErrorString(err)); @@ -130,12 +131,12 @@ BOOST_AUTO_TEST_CASE(multisig_verify) s = sign_multisig(escrow, keys, txTo[2], 0); if (i < j && i < 3 && j < 3) { - BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, flags, MutableTransactionSignatureChecker(&txTo[2], 0), &err), strprintf("escrow 1: %d %d", i, j)); + BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, NULL, flags, MutableTransactionSignatureChecker(&txTo[2], 0, amount), &err), strprintf("escrow 1: %d %d", i, j)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } else { - BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, flags, MutableTransactionSignatureChecker(&txTo[2], 0), &err), strprintf("escrow 2: %d %d", i, j)); + BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, NULL, flags, MutableTransactionSignatureChecker(&txTo[2], 0, amount), &err), strprintf("escrow 2: %d %d", i, j)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); } } diff --git a/src/test/netbase_tests.cpp b/src/test/netbase_tests.cpp index b1ef0ed24a72e..4168f75e9a420 100644 --- a/src/test/netbase_tests.cpp +++ b/src/test/netbase_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp index 0d7fb2bc35cdf..113b9437e0490 100644 --- a/src/test/pmt_tests.cpp +++ b/src/test/pmt_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp index 644c3da213a99..4e5e35b295cf0 100644 --- a/src/test/policyestimator_tests.cpp +++ b/src/test/policyestimator_tests.cpp @@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) tx.vin[0].scriptSig = garbage; tx.vout.resize(1); tx.vout[0].nValue=0LL; - CFeeRate baseRate(basefee, ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)); + CFeeRate baseRate(basefee, GetVirtualTransactionSize(tx)); // Create a fake block std::vector block; diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index ce22975005b1b..cc52e3ea06af6 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -237,7 +237,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) UniValue o1 = ar[0].get_obj(); UniValue adr = find_value(o1, "address"); BOOST_CHECK_EQUAL(adr.get_str(), "127.0.0.0/32"); - BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0 remove")));; + BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0 remove"))); BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); ar = r.get_array(); BOOST_CHECK_EQUAL(ar.size(), 0); @@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) // must throw an exception because 127.0.0.1 is in already banned suubnet range BOOST_CHECK_THROW(r = CallRPC(string("setban 127.0.0.1 add")), runtime_error); - BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove")));; + BOOST_CHECK_NO_THROW(CallRPC(string("setban 127.0.0.0/24 remove"))); BOOST_CHECK_NO_THROW(r = CallRPC(string("listbanned"))); ar = r.get_array(); BOOST_CHECK_EQUAL(ar.size(), 0); diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index 2e652f76e272d..398372af3ce2e 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2014 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/sanity_tests.cpp b/src/test/sanity_tests.cpp index f5f7f381d3157..51f9e9f39fd64 100644 --- a/src/test/sanity_tests.cpp +++ b/src/test/sanity_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/scheduler_tests.cpp b/src/test/scheduler_tests.cpp index fc07aa72c19d9..9acd0e2430a30 100644 --- a/src/test/scheduler_tests.cpp +++ b/src/test/scheduler_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index e36aca8dfaab2..d8c05bd71feda 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -1,7 +1,8 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include "core_io.h" #include "key.h" #include "keystore.h" #include "main.h" @@ -45,7 +46,7 @@ Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, Scri txTo.vin[0].scriptSig = scriptSig; txTo.vout[0].nValue = 1; - return VerifyScript(scriptSig, scriptPubKey, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, MutableTransactionSignatureChecker(&txTo, 0), &err); + return VerifyScript(scriptSig, scriptPubKey, NULL, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, MutableTransactionSignatureChecker(&txTo, 0, txFrom.vout[0].nValue), &err); } diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 0059e4a998ef2..2415345b63bf1 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -89,15 +89,20 @@ CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMu void DoTest(const CScript& scriptPubKey, const CScript& scriptSig, int flags, bool expect, const std::string& message) { + if (flags & SCRIPT_VERIFY_CLEANSTACK) { + flags |= SCRIPT_VERIFY_P2SH; + flags |= SCRIPT_VERIFY_WITNESS; + } ScriptError err; - CMutableTransaction tx = BuildSpendingTransaction(scriptSig, BuildCreditingTransaction(scriptPubKey)); + CMutableTransaction txCredit = BuildCreditingTransaction(scriptPubKey); + CMutableTransaction tx = BuildSpendingTransaction(scriptSig, txCredit); CMutableTransaction tx2 = tx; - BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, flags, MutableTransactionSignatureChecker(&tx, 0), &err) == expect, message); + BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, txCredit.vout[0].scriptPubKey, NULL, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue), &err) == expect, message); BOOST_CHECK_MESSAGE(expect == (err == SCRIPT_ERR_OK), std::string(ScriptErrorString(err)) + ": " + message); #if defined(HAVE_CONSENSUS_LIB) CDataStream stream(SER_NETWORK, PROTOCOL_VERSION); stream << tx2; - BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); + BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(begin_ptr(scriptPubKey), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, flags, NULL) == expect,message); #endif } @@ -236,7 +241,7 @@ class TestBuilder TestBuilder& PushSig(const CKey& key, int nHashType = SIGHASH_ALL, unsigned int lenR = 32, unsigned int lenS = 32) { - uint256 hash = SignatureHash(scriptPubKey, spendTx, 0, nHashType); + uint256 hash = SignatureHash(scriptPubKey, spendTx, 0, nHashType, 0, 0); std::vector vchSig, r, s; uint32_t iter = 0; do { @@ -692,21 +697,21 @@ BOOST_AUTO_TEST_CASE(script_PushData) ScriptError err; vector > directStack; - BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), &err)); + BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), 0, &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); vector > pushdata1Stack; - BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), &err)); + BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), 0, &err)); BOOST_CHECK(pushdata1Stack == directStack); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); vector > pushdata2Stack; - BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), &err)); + BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), 0, &err)); BOOST_CHECK(pushdata2Stack == directStack); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); vector > pushdata4Stack; - BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), &err)); + BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), 0, &err)); BOOST_CHECK(pushdata4Stack == directStack); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } @@ -714,7 +719,7 @@ BOOST_AUTO_TEST_CASE(script_PushData) CScript sign_multisig(CScript scriptPubKey, std::vector keys, CTransaction transaction) { - uint256 hash = SignatureHash(scriptPubKey, transaction, 0, SIGHASH_ALL); + uint256 hash = SignatureHash(scriptPubKey, transaction, 0, SIGHASH_ALL, 0, 0); CScript result; // @@ -758,18 +763,18 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12) CMutableTransaction txTo12 = BuildSpendingTransaction(CScript(), txFrom12); CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, flags, MutableTransactionSignatureChecker(&txTo12, 0), &err)); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, NULL, flags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); txTo12.vout[0].nValue = 2; - BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, flags, MutableTransactionSignatureChecker(&txTo12, 0), &err)); + BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, NULL, flags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); CScript goodsig2 = sign_multisig(scriptPubKey12, key2, txTo12); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, flags, MutableTransactionSignatureChecker(&txTo12, 0), &err)); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, NULL, flags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); CScript badsig1 = sign_multisig(scriptPubKey12, key3, txTo12); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, flags, MutableTransactionSignatureChecker(&txTo12, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, NULL, flags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); } @@ -791,54 +796,54 @@ BOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23) std::vector keys; keys.push_back(key1); keys.push_back(key2); CScript goodsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); keys.clear(); keys.push_back(key1); keys.push_back(key3); CScript goodsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); keys.clear(); keys.push_back(key2); keys.push_back(key3); CScript goodsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); keys.clear(); keys.push_back(key2); keys.push_back(key2); // Can't re-use sig CScript badsig1 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key2); keys.push_back(key1); // sigs must be in correct order CScript badsig2 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key3); keys.push_back(key2); // sigs must be in correct order CScript badsig3 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key4); keys.push_back(key2); // sigs must match pubkeys CScript badsig4 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); keys.push_back(key1); keys.push_back(key4); // sigs must match pubkeys CScript badsig5 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err)); keys.clear(); // Must have signatures CScript badsig6 = sign_multisig(scriptPubKey23, keys, txTo23); - BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, flags, MutableTransactionSignatureChecker(&txTo23, 0), &err)); + BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, NULL, flags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err)); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString(err)); } @@ -846,6 +851,7 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) { // Test the CombineSignatures function CBasicKeyStore keystore; + CAmount amount = 0; vector keys; vector pubkeys; for (int i = 0; i < 3; i++) @@ -862,62 +868,62 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) CScript& scriptPubKey = txFrom.vout[0].scriptPubKey; CScript& scriptSig = txTo.vin[0].scriptSig; - CScript empty; - CScript combined = CombineSignatures(scriptPubKey, txTo, 0, empty, empty); - BOOST_CHECK(combined.empty()); + SignatureData empty; + SignatureData combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, empty); + BOOST_CHECK(combined.scriptSig.empty()); // Single signature case: SignSignature(keystore, txFrom, txTo, 0); // changes scriptSig - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty); - BOOST_CHECK(combined == scriptSig); - combined = CombineSignatures(scriptPubKey, txTo, 0, empty, scriptSig); - BOOST_CHECK(combined == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), empty); + BOOST_CHECK(combined.scriptSig == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, SignatureData(scriptSig)); + BOOST_CHECK(combined.scriptSig == scriptSig); CScript scriptSigCopy = scriptSig; // Signing again will give a different, valid signature: SignSignature(keystore, txFrom, txTo, 0); - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSigCopy, scriptSig); - BOOST_CHECK(combined == scriptSigCopy || combined == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig)); + BOOST_CHECK(combined.scriptSig == scriptSigCopy || combined.scriptSig == scriptSig); // P2SH, single-signature case: CScript pkSingle; pkSingle << ToByteVector(keys[0].GetPubKey()) << OP_CHECKSIG; keystore.AddCScript(pkSingle); scriptPubKey = GetScriptForDestination(CScriptID(pkSingle)); SignSignature(keystore, txFrom, txTo, 0); - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty); - BOOST_CHECK(combined == scriptSig); - combined = CombineSignatures(scriptPubKey, txTo, 0, empty, scriptSig); - BOOST_CHECK(combined == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), empty); + BOOST_CHECK(combined.scriptSig == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, SignatureData(scriptSig)); + BOOST_CHECK(combined.scriptSig == scriptSig); scriptSigCopy = scriptSig; SignSignature(keystore, txFrom, txTo, 0); - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSigCopy, scriptSig); - BOOST_CHECK(combined == scriptSigCopy || combined == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig)); + BOOST_CHECK(combined.scriptSig == scriptSigCopy || combined.scriptSig == scriptSig); // dummy scriptSigCopy with placeholder, should always choose non-placeholder: - scriptSigCopy = CScript() << OP_0 << vector(pkSingle.begin(), pkSingle.end()); - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSigCopy, scriptSig); - BOOST_CHECK(combined == scriptSig); - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, scriptSigCopy); - BOOST_CHECK(combined == scriptSig); + scriptSigCopy = CScript() << OP_0 << std::vector(pkSingle.begin(), pkSingle.end()); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig)); + BOOST_CHECK(combined.scriptSig == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), SignatureData(scriptSigCopy)); + BOOST_CHECK(combined.scriptSig == scriptSig); // Hardest case: Multisig 2-of-3 scriptPubKey = GetScriptForMultisig(2, pubkeys); keystore.AddCScript(scriptPubKey); SignSignature(keystore, txFrom, txTo, 0); - combined = CombineSignatures(scriptPubKey, txTo, 0, scriptSig, empty); - BOOST_CHECK(combined == scriptSig); - combined = CombineSignatures(scriptPubKey, txTo, 0, empty, scriptSig); - BOOST_CHECK(combined == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), empty); + BOOST_CHECK(combined.scriptSig == scriptSig); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, SignatureData(scriptSig)); + BOOST_CHECK(combined.scriptSig == scriptSig); // A couple of partially-signed versions: vector sig1; - uint256 hash1 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_ALL); + uint256 hash1 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_ALL, 0, 0); BOOST_CHECK(keys[0].Sign(hash1, sig1)); sig1.push_back(SIGHASH_ALL); vector sig2; - uint256 hash2 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_NONE); + uint256 hash2 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_NONE, 0, 0); BOOST_CHECK(keys[1].Sign(hash2, sig2)); sig2.push_back(SIGHASH_NONE); vector sig3; - uint256 hash3 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_SINGLE); + uint256 hash3 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_SINGLE, 0, 0); BOOST_CHECK(keys[2].Sign(hash3, sig3)); sig3.push_back(SIGHASH_SINGLE); @@ -933,22 +939,22 @@ BOOST_AUTO_TEST_CASE(script_combineSigs) CScript complete13 = CScript() << OP_0 << sig1 << sig3; CScript complete23 = CScript() << OP_0 << sig2 << sig3; - combined = CombineSignatures(scriptPubKey, txTo, 0, partial1a, partial1b); - BOOST_CHECK(combined == partial1a); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial1a, partial2a); - BOOST_CHECK(combined == complete12); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial2a, partial1a); - BOOST_CHECK(combined == complete12); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial1b, partial2b); - BOOST_CHECK(combined == complete12); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial3b, partial1b); - BOOST_CHECK(combined == complete13); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial2a, partial3a); - BOOST_CHECK(combined == complete23); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial3b, partial2b); - BOOST_CHECK(combined == complete23); - combined = CombineSignatures(scriptPubKey, txTo, 0, partial3b, partial3a); - BOOST_CHECK(combined == partial3c); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial1a), SignatureData(partial1b)); + BOOST_CHECK(combined.scriptSig == partial1a); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial1a), SignatureData(partial2a)); + BOOST_CHECK(combined.scriptSig == complete12); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial2a), SignatureData(partial1a)); + BOOST_CHECK(combined.scriptSig == complete12); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial1b), SignatureData(partial2b)); + BOOST_CHECK(combined.scriptSig == complete12); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial3b), SignatureData(partial1b)); + BOOST_CHECK(combined.scriptSig == complete13); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial2a), SignatureData(partial3a)); + BOOST_CHECK(combined.scriptSig == complete23); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial3b), SignatureData(partial2b)); + BOOST_CHECK(combined.scriptSig == complete23); + combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial3b), SignatureData(partial3a)); + BOOST_CHECK(combined.scriptSig == partial3c); } BOOST_AUTO_TEST_CASE(script_standard_push) @@ -958,7 +964,7 @@ BOOST_AUTO_TEST_CASE(script_standard_push) CScript script; script << i; BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Number " << i << " is not pure push."); - BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), "Number " << i << " push is not minimal data."); + BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, NULL, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), "Number " << i << " push is not minimal data."); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } @@ -967,7 +973,7 @@ BOOST_AUTO_TEST_CASE(script_standard_push) CScript script; script << data; BOOST_CHECK_MESSAGE(script.IsPushOnly(), "Length " << i << " is not pure push."); - BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), "Length " << i << " push is not minimal data."); + BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, NULL, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), "Length " << i << " push is not minimal data."); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } } @@ -985,10 +991,10 @@ BOOST_AUTO_TEST_CASE(script_IsPushOnly_on_invalid_scripts) BOOST_AUTO_TEST_CASE(script_GetScriptAsm) { - BOOST_CHECK_EQUAL("OP_NOP2", ScriptToAsmStr(CScript() << OP_NOP2, true)); - BOOST_CHECK_EQUAL("OP_NOP2", ScriptToAsmStr(CScript() << OP_CHECKLOCKTIMEVERIFY, true)); - BOOST_CHECK_EQUAL("OP_NOP2", ScriptToAsmStr(CScript() << OP_NOP2)); - BOOST_CHECK_EQUAL("OP_NOP2", ScriptToAsmStr(CScript() << OP_CHECKLOCKTIMEVERIFY)); + BOOST_CHECK_EQUAL("OP_CHECKLOCKTIMEVERIFY", ScriptToAsmStr(CScript() << OP_NOP2, true)); + BOOST_CHECK_EQUAL("OP_CHECKLOCKTIMEVERIFY", ScriptToAsmStr(CScript() << OP_CHECKLOCKTIMEVERIFY, true)); + BOOST_CHECK_EQUAL("OP_CHECKLOCKTIMEVERIFY", ScriptToAsmStr(CScript() << OP_NOP2)); + BOOST_CHECK_EQUAL("OP_CHECKLOCKTIMEVERIFY", ScriptToAsmStr(CScript() << OP_CHECKLOCKTIMEVERIFY)); string derSig("304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c5090"); string pubKey("03b0da749730dc9b4b1f4a14d6902877a92541f5368778853d9c4a0cb7802dcfb2"); diff --git a/src/test/scriptnum10.h b/src/test/scriptnum10.h index 00419746b7ebf..94dd58526cbb2 100644 --- a/src/test/scriptnum10.h +++ b/src/test/scriptnum10.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/scriptnum_tests.cpp b/src/test/scriptnum_tests.cpp index 2405ab3ffc0dc..6b6689c7d3539 100644 --- a/src/test/scriptnum_tests.cpp +++ b/src/test/scriptnum_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/serialize_tests.cpp b/src/test/serialize_tests.cpp index cc8f2b788d6d5..c0fd99aca2e67 100644 --- a/src/test/serialize_tests.cpp +++ b/src/test/serialize_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 6fca64d5da3cd..0df5f3c88ba2c 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2013 The Bitcoin Core developers +// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -143,7 +143,7 @@ BOOST_AUTO_TEST_CASE(sighash_test) uint256 sh, sho; sho = SignatureHashOld(scriptCode, txTo, nIn, nHashType); - sh = SignatureHash(scriptCode, txTo, nIn, nHashType); + sh = SignatureHash(scriptCode, txTo, nIn, nHashType, 0, 0); #if defined(PRINT_SIGHASH_JSON) CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss << txTo; @@ -210,7 +210,7 @@ BOOST_AUTO_TEST_CASE(sighash_from_data) continue; } - sh = SignatureHash(scriptCode, tx, nIn, nHashType); + sh = SignatureHash(scriptCode, tx, nIn, nHashType, 0, 0); BOOST_CHECK_MESSAGE(sh.GetHex() == sigHashHex, strTest); } } diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp index ea2b9b795f023..a207fd9216a10 100644 --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/skiplist_tests.cpp b/src/test/skiplist_tests.cpp index a904e3862fe78..f14b902fe19a8 100644 --- a/src/test/skiplist_tests.cpp +++ b/src/test/skiplist_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/streams_tests.cpp b/src/test/streams_tests.cpp index 0ed8f363d7893..34f501e867e71 100644 --- a/src/test/streams_tests.cpp +++ b/src/test/streams_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 2147dbb065336..61968d9822ae9 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -126,7 +126,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector& block.vtx.push_back(tx); // IncrementExtraNonce creates a valid coinbase and merkleRoot unsigned int extraNonce = 0; - IncrementExtraNonce(&block, chainActive.Tip(), extraNonce); + IncrementExtraNonce(&block, chainActive.Tip(), extraNonce, pblocktemplate->vchCoinbaseCommitment); while (!CheckProofOfWork(block.GetHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce; diff --git a/src/test/timedata_tests.cpp b/src/test/timedata_tests.cpp index 887cfb47613e9..1224ff84547d4 100644 --- a/src/test/timedata_tests.cpp +++ b/src/test/timedata_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. // diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index fb0df1aff431d..a81352cdd3680 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -14,7 +14,9 @@ #include "main.h" // For CheckTransaction #include "policy/policy.h" #include "script/script.h" +#include "script/sign.h" #include "script/script_error.h" +#include "script/standard.h" #include "utilstrencodings.h" #include @@ -25,11 +27,14 @@ #include #include #include +#include #include using namespace std; +typedef vector valtype; + // In script_tests.cpp extern UniValue read_json(const std::string& jsondata); @@ -148,9 +153,10 @@ BOOST_AUTO_TEST_CASE(tx_valid) break; } + CAmount amount = 0; unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - verify_flags, TransactionSignatureChecker(&tx, i), &err), + NULL, verify_flags, TransactionSignatureChecker(&tx, i, amount), &err), strTest); BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err)); } @@ -223,8 +229,9 @@ BOOST_AUTO_TEST_CASE(tx_invalid) } unsigned int verify_flags = ParseScriptFlags(test[2].get_str()); + CAmount amount = 0; fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout], - verify_flags, TransactionSignatureChecker(&tx, i), &err); + NULL, verify_flags, TransactionSignatureChecker(&tx, i, amount), &err); } BOOST_CHECK_MESSAGE(!fValid, strTest); BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err)); @@ -320,6 +327,278 @@ BOOST_AUTO_TEST_CASE(test_Get) BOOST_CHECK(!AreInputsStandard(t1, coins)); } +void CreateCreditAndSpend(const CKeyStore& keystore, const CScript& outscript, CTransaction& output, CMutableTransaction& input, bool success = true) +{ + CMutableTransaction outputm; + outputm.nVersion = 1; + outputm.vin.resize(1); + outputm.vin[0].prevout.SetNull(); + outputm.vin[0].scriptSig = CScript(); + outputm.wit.vtxinwit.resize(1); + outputm.vout.resize(1); + outputm.vout[0].nValue = 1; + outputm.vout[0].scriptPubKey = outscript; + CDataStream ssout(SER_NETWORK, PROTOCOL_VERSION); + WithOrVersion(&ssout, SERIALIZE_TRANSACTION_WITNESS) << outputm; + WithOrVersion(&ssout, SERIALIZE_TRANSACTION_WITNESS) >> output; + assert(output.vin.size() == 1); + assert(output.vin[0] == outputm.vin[0]); + assert(output.vout.size() == 1); + assert(output.vout[0] == outputm.vout[0]); + assert(output.wit.vtxinwit.size() == 0); + + CMutableTransaction inputm; + inputm.nVersion = 1; + inputm.vin.resize(1); + inputm.vin[0].prevout.hash = output.GetHash(); + inputm.vin[0].prevout.n = 0; + inputm.wit.vtxinwit.resize(1); + inputm.vout.resize(1); + inputm.vout[0].nValue = 1; + inputm.vout[0].scriptPubKey = CScript(); + bool ret = SignSignature(keystore, output, inputm, 0); + assert(ret == success); + CDataStream ssin(SER_NETWORK, PROTOCOL_VERSION); + WithOrVersion(&ssin, SERIALIZE_TRANSACTION_WITNESS) << inputm; + WithOrVersion(&ssin, SERIALIZE_TRANSACTION_WITNESS) >> input; + assert(input.vin.size() == 1); + assert(input.vin[0] == inputm.vin[0]); + assert(input.vout.size() == 1); + assert(input.vout[0] == inputm.vout[0]); + if (inputm.wit.IsNull()) { + assert(input.wit.IsNull()); + } else { + assert(!input.wit.IsNull()); + assert(input.wit.vtxinwit.size() == 1); + assert(input.wit.vtxinwit[0].scriptWitness.stack == inputm.wit.vtxinwit[0].scriptWitness.stack); + } +} + +void CheckWithFlag(const CTransaction& output, const CMutableTransaction& input, int flags, bool success) +{ + ScriptError error; + CTransaction inputi(input); + bool ret = VerifyScript(inputi.vin[0].scriptSig, output.vout[0].scriptPubKey, inputi.wit.vtxinwit.size() > 0 ? &inputi.wit.vtxinwit[0].scriptWitness : NULL, flags, TransactionSignatureChecker(&inputi, 0, output.vout[0].nValue), &error); + assert(ret == success); +} + +static CScript PushAll(const vector& values) +{ + CScript result; + BOOST_FOREACH(const valtype& v, values) { + if (v.size() == 0) { + result << OP_0; + } else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) { + result << CScript::EncodeOP_N(v[0]); + } else { + result << v; + } + } + return result; +} + +void ReplaceRedeemScript(CScript& script, const CScript& redeemScript) +{ + vector stack; + EvalScript(stack, script, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker(), 0); + assert(stack.size() > 0); + stack.back() = std::vector(redeemScript.begin(), redeemScript.end()); + script = PushAll(stack); +} + +BOOST_AUTO_TEST_CASE(test_witness) +{ + ScriptError serror; + CBasicKeyStore keystore, keystore2; + CKey key1, key2, key3, key1L, key2L; + CPubKey pubkey1, pubkey2, pubkey3, pubkey1L, pubkey2L; + key1.MakeNewKey(true); + key2.MakeNewKey(true); + key3.MakeNewKey(true); + key1L.MakeNewKey(false); + key2L.MakeNewKey(false); + pubkey1 = key1.GetPubKey(); + pubkey2 = key2.GetPubKey(); + pubkey3 = key3.GetPubKey(); + pubkey1L = key1L.GetPubKey(); + pubkey2L = key2L.GetPubKey(); + keystore.AddKeyPubKey(key1, pubkey1); + keystore.AddKeyPubKey(key2, pubkey2); + keystore.AddKeyPubKey(key1L, pubkey1L); + keystore.AddKeyPubKey(key2L, pubkey2L); + CScript scriptPubkey1, scriptPubkey2, scriptPubkey1L, scriptPubkey2L, scriptMulti; + scriptPubkey1 << ToByteVector(pubkey1) << OP_CHECKSIG; + scriptPubkey2 << ToByteVector(pubkey2) << OP_CHECKSIG; + scriptPubkey1L << ToByteVector(pubkey1L) << OP_CHECKSIG; + scriptPubkey2L << ToByteVector(pubkey2L) << OP_CHECKSIG; + std::vector oneandthree; + oneandthree.push_back(pubkey1); + oneandthree.push_back(pubkey3); + scriptMulti = GetScriptForMultisig(2, oneandthree); + keystore.AddCScript(scriptPubkey1); + keystore.AddCScript(scriptPubkey2); + keystore.AddCScript(scriptPubkey1L); + keystore.AddCScript(scriptPubkey2L); + keystore.AddCScript(scriptMulti); + keystore.AddCScript(GetScriptForWitness(scriptPubkey1)); + keystore.AddCScript(GetScriptForWitness(scriptPubkey2)); + keystore.AddCScript(GetScriptForWitness(scriptPubkey1L)); + keystore.AddCScript(GetScriptForWitness(scriptPubkey2L)); + keystore.AddCScript(GetScriptForWitness(scriptMulti)); + keystore2.AddCScript(scriptMulti); + keystore2.AddCScript(GetScriptForWitness(scriptMulti)); + keystore2.AddKeyPubKey(key3, pubkey3); + + CTransaction output1, output2; + CMutableTransaction input1, input2; + SignatureData sigdata; + + // Normal pay-to-compressed-pubkey. + CreateCreditAndSpend(keystore, scriptPubkey1, output1, input1); + CreateCreditAndSpend(keystore, scriptPubkey2, output2, input2); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, false); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // P2SH pay-to-compressed-pubkey. + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey1)), output1, input1); + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey2)), output2, input2); + ReplaceRedeemScript(input2.vin[0].scriptSig, scriptPubkey1); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // Witness pay-to-compressed-pubkey (v0). + CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey1), output1, input1); + CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey2), output2, input2); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // P2SH witness pay-to-compressed-pubkey (v0). + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey1))), output1, input1); + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey2))), output2, input2); + ReplaceRedeemScript(input2.vin[0].scriptSig, GetScriptForWitness(scriptPubkey1)); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // Normal pay-to-uncompressed-pubkey. + CreateCreditAndSpend(keystore, scriptPubkey1L, output1, input1); + CreateCreditAndSpend(keystore, scriptPubkey2L, output2, input2); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, false); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // P2SH pay-to-uncompressed-pubkey. + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey1L)), output1, input1); + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey2L)), output2, input2); + ReplaceRedeemScript(input2.vin[0].scriptSig, scriptPubkey1L); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // Witness pay-to-uncompressed-pubkey (v1). + CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey1L), output1, input1); + CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey2L), output2, input2); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // P2SH witness pay-to-uncompressed-pubkey (v1). + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey1L))), output1, input1); + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey2L))), output2, input2); + ReplaceRedeemScript(input2.vin[0].scriptSig, GetScriptForWitness(scriptPubkey1L)); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + CheckWithFlag(output1, input2, 0, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false); + CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false); + + // Normal 2-of-2 multisig + CreateCreditAndSpend(keystore, scriptMulti, output1, input1, false); + CheckWithFlag(output1, input1, 0, false); + CreateCreditAndSpend(keystore2, scriptMulti, output2, input2, false); + CheckWithFlag(output2, input2, 0, false); + BOOST_CHECK(output1 == output2); + UpdateTransaction(input1, 0, CombineSignatures(output1.vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1.vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0))); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + + // P2SH 2-of-2 multisig + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptMulti)), output1, input1, false); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, false); + CreateCreditAndSpend(keystore2, GetScriptForDestination(CScriptID(scriptMulti)), output2, input2, false); + CheckWithFlag(output2, input2, 0, true); + CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH, false); + BOOST_CHECK(output1 == output2); + UpdateTransaction(input1, 0, CombineSignatures(output1.vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1.vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0))); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + + // Witness 2-of-2 multisig + CreateCreditAndSpend(keystore, GetScriptForWitness(scriptMulti), output1, input1, false); + CheckWithFlag(output1, input1, 0, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false); + CreateCreditAndSpend(keystore2, GetScriptForWitness(scriptMulti), output2, input2, false); + CheckWithFlag(output2, input2, 0, true); + CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false); + BOOST_CHECK(output1 == output2); + UpdateTransaction(input1, 0, CombineSignatures(output1.vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1.vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0))); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); + + // P2SH witness 2-of-2 multisig + CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptMulti))), output1, input1, false); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false); + CreateCreditAndSpend(keystore2, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptMulti))), output2, input2, false); + CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH, true); + CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false); + BOOST_CHECK(output1 == output2); + UpdateTransaction(input1, 0, CombineSignatures(output1.vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1.vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0))); + CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, true); + CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true); +} + BOOST_AUTO_TEST_CASE(test_IsStandard) { LOCK(cs_main); diff --git a/src/test/txvalidationcache_tests.cpp b/src/test/txvalidationcache_tests.cpp index 9b8e1c088b2d3..968807bd8722f 100644 --- a/src/test/txvalidationcache_tests.cpp +++ b/src/test/txvalidationcache_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -48,7 +48,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup) // Sign: std::vector vchSig; - uint256 hash = SignatureHash(scriptPubKey, spends[i], 0, SIGHASH_ALL); + uint256 hash = SignatureHash(scriptPubKey, spends[i], 0, SIGHASH_ALL, 0, 0); BOOST_CHECK(coinbaseKey.Sign(hash, vchSig)); vchSig.push_back((unsigned char)SIGHASH_ALL); spends[i].vin[0].scriptSig << vchSig; diff --git a/src/test/uint256_tests.cpp b/src/test/uint256_tests.cpp index 426d296a9ac56..da0a3d73e07be 100644 --- a/src/test/uint256_tests.cpp +++ b/src/test/uint256_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2013 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "arith_uint256.h" diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 997dc31931f7d..28cecfffaf7d4 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2014 The Bitcoin Core developers +// Copyright (c) 2011-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/timedata.cpp b/src/timedata.cpp index 861c37598908e..de8cc62b2401e 100644 --- a/src/timedata.cpp +++ b/src/timedata.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014 The Bitcoin Core developers +// Copyright (c) 2014-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/txdb.cpp b/src/txdb.cpp index cd76c0155cfd2..3515115fdd8ba 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -175,7 +175,7 @@ bool CBlockTreeDB::ReadFlag(const std::string &name, bool &fValue) { return true; } -bool CBlockTreeDB::LoadBlockIndexGuts() +bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams) { boost::scoped_ptr pcursor(NewIterator()); @@ -203,7 +203,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nStatus = diskindex.nStatus; pindexNew->nTx = diskindex.nTx; - if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, Params().GetConsensus())) + if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, consensusParams) && + pindexNew->GetBlockHash() != consensusParams.hashGenesisBlock) return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString()); pcursor->Next(); diff --git a/src/txdb.h b/src/txdb.h index 586ab55d0d550..196ef8a19a37e 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -18,6 +18,7 @@ class CBlockFileInfo; class CBlockIndex; struct CDiskTxPos; class uint256; +namespace Consensus { struct Params; } //! -dbcache default (MiB) static const int64_t nDefaultDbCache = 100; @@ -59,7 +60,7 @@ class CBlockTreeDB : public CDBWrapper bool WriteTxIndex(const std::vector > &list); bool WriteFlag(const std::string &name, bool fValue); bool ReadFlag(const std::string &name, bool &fValue); - bool LoadBlockIndexGuts(); + bool LoadBlockIndexGuts(const Consensus::Params& consensusParams); }; #endif // BITCOIN_TXDB_H diff --git a/src/txmempool.cpp b/src/txmempool.cpp index fea5da80293ca..792604ee46f13 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -27,13 +27,13 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, hadNoDependencies(poolHasNoInputsOf), inChainInputValue(_inChainInputValue), spendsCoinbase(_spendsCoinbase), sigOpCount(_sigOps) { - nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); + nTxSize = GetVirtualTransactionSize(tx); nModSize = tx.CalculateModifiedSize(nTxSize); nUsageSize = RecursiveDynamicUsage(tx); nCountWithDescendants = 1; nSizeWithDescendants = nTxSize; - nFeesWithDescendants = nFee; + nModFeesWithDescendants = nFee; CAmount nValueIn = tx.GetValueOut()+nFee; assert(inChainInputValue <= nValueIn); @@ -57,6 +57,7 @@ CTxMemPoolEntry::GetPriority(unsigned int currentHeight) const void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta) { + nModFeesWithDescendants += newFeeDelta - feeDelta; feeDelta = newFeeDelta; } @@ -114,7 +115,7 @@ bool CTxMemPool::UpdateForDescendants(txiter updateIt, int maxDescendantsToVisit BOOST_FOREACH(txiter cit, setAllDescendants) { if (!setExclude.count(cit->GetTx().GetHash())) { modifySize += cit->GetTxSize(); - modifyFee += cit->GetFee(); + modifyFee += cit->GetModifiedFee(); modifyCount++; cachedDescendants[updateIt].insert(cit); } @@ -244,7 +245,7 @@ void CTxMemPool::UpdateAncestorsOf(bool add, txiter it, setEntries &setAncestors } const int64_t updateCount = (add ? 1 : -1); const int64_t updateSize = updateCount * it->GetTxSize(); - const CAmount updateFee = updateCount * it->GetFee(); + const CAmount updateFee = updateCount * it->GetModifiedFee(); BOOST_FOREACH(txiter ancestorIt, setAncestors) { mapTx.modify(ancestorIt, update_descendant_state(updateSize, updateFee, updateCount)); } @@ -304,7 +305,7 @@ void CTxMemPoolEntry::SetDirty() { nCountWithDescendants = 0; nSizeWithDescendants = nTxSize; - nFeesWithDescendants = nFee; + nModFeesWithDescendants = GetModifiedFee(); } void CTxMemPoolEntry::UpdateState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount) @@ -312,8 +313,7 @@ void CTxMemPoolEntry::UpdateState(int64_t modifySize, CAmount modifyFee, int64_t if (!IsDirty()) { nSizeWithDescendants += modifySize; assert(int64_t(nSizeWithDescendants) > 0); - nFeesWithDescendants += modifyFee; - assert(nFeesWithDescendants >= 0); + nModFeesWithDescendants += modifyFee; nCountWithDescendants += modifyCount; assert(int64_t(nCountWithDescendants) > 0); } @@ -372,6 +372,17 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, indexed_transaction_set::iterator newit = mapTx.insert(entry).first; mapLinks.insert(make_pair(newit, TxLinks())); + // Update transaction for any feeDelta created by PrioritiseTransaction + // TODO: refactor so that the fee delta is calculated before inserting + // into mapTx. + std::map >::const_iterator pos = mapDeltas.find(hash); + if (pos != mapDeltas.end()) { + const std::pair &deltas = pos->second; + if (deltas.second) { + mapTx.modify(newit, update_fee_delta(deltas.second)); + } + } + // Update cachedInnerUsage to include contained transaction's usage. // (When we update the entry for in-mempool parents, memory usage will be // further updated.) @@ -399,15 +410,6 @@ bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, } UpdateAncestorsOf(true, newit, setAncestors); - // Update transaction's score for any feeDelta created by PrioritiseTransaction - std::map >::const_iterator pos = mapDeltas.find(hash); - if (pos != mapDeltas.end()) { - const std::pair &deltas = pos->second; - if (deltas.second) { - mapTx.modify(newit, update_fee_delta(deltas.second)); - } - } - nTransactionsUpdated++; totalTxSize += entry.GetTxSize(); minerPolicyEstimator->processTransaction(entry, fCurrentEstimate); @@ -644,27 +646,24 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const CTxMemPool::setEntries setChildrenCheck; std::map::const_iterator iter = mapNextTx.lower_bound(COutPoint(it->GetTx().GetHash(), 0)); int64_t childSizes = 0; - CAmount childFees = 0; + CAmount childModFee = 0; for (; iter != mapNextTx.end() && iter->first.hash == it->GetTx().GetHash(); ++iter) { txiter childit = mapTx.find(iter->second.ptx->GetHash()); assert(childit != mapTx.end()); // mapNextTx points to in-mempool transactions if (setChildrenCheck.insert(childit).second) { childSizes += childit->GetTxSize(); - childFees += childit->GetFee(); + childModFee += childit->GetModifiedFee(); } } assert(setChildrenCheck == GetMemPoolChildren(it)); - // Also check to make sure size/fees is greater than sum with immediate children. + // Also check to make sure size is greater than sum with immediate children. // just a sanity check, not definitive that this calc is correct... - // also check that the size is less than the size of the entire mempool. if (!it->IsDirty()) { assert(it->GetSizeWithDescendants() >= childSizes + it->GetTxSize()); - assert(it->GetFeesWithDescendants() >= childFees + it->GetFee()); } else { assert(it->GetSizeWithDescendants() == it->GetTxSize()); - assert(it->GetFeesWithDescendants() == it->GetFee()); + assert(it->GetModFeesWithDescendants() == it->GetModifiedFee()); } - assert(it->GetFeesWithDescendants() >= 0); if (fDependsWait) waitingOnDependants.push_back(&(*it)); @@ -788,6 +787,14 @@ void CTxMemPool::PrioritiseTransaction(const uint256 hash, const string strHash, txiter it = mapTx.find(hash); if (it != mapTx.end()) { mapTx.modify(it, update_fee_delta(deltas.second)); + // Now update all ancestors' modified fees with descendants + setEntries setAncestors; + uint64_t nNoLimit = std::numeric_limits::max(); + std::string dummy; + CalculateMemPoolAncestors(*it, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false); + BOOST_FOREACH(txiter ancestorIt, setAncestors) { + mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0)); + } } } LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, FormatMoney(nFeeDelta)); @@ -956,7 +963,7 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector* pvNoSpendsRe // "minimum reasonable fee rate" (ie some value under which we consider txn // to have 0 fee). This way, we don't allow txn to enter mempool with feerate // equal to txn which were removed with no block in between. - CFeeRate removed(it->GetFeesWithDescendants(), it->GetSizeWithDescendants()); + CFeeRate removed(it->GetModFeesWithDescendants(), it->GetSizeWithDescendants()); removed += minReasonableRelayFee; trackPackageRemoved(removed); maxFeeRateRemoved = std::max(maxFeeRateRemoved, removed); diff --git a/src/txmempool.h b/src/txmempool.h index 92031718686e5..386cb26d2565a 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -44,12 +44,12 @@ class CTxMemPool; * ("descendant" transactions). * * When a new entry is added to the mempool, we update the descendant state - * (nCountWithDescendants, nSizeWithDescendants, and nFeesWithDescendants) for + * (nCountWithDescendants, nSizeWithDescendants, and nModFeesWithDescendants) for * all ancestors of the newly added transaction. * * If updating the descendant state is skipped, we can mark the entry as - * "dirty", and set nSizeWithDescendants/nFeesWithDescendants to equal nTxSize/ - * nTxFee. (This can potentially happen during a reorg, where we limit the + * "dirty", and set nSizeWithDescendants/nModFeesWithDescendants to equal nTxSize/ + * nFee+feeDelta. (This can potentially happen during a reorg, where we limit the * amount of work we're willing to do to avoid consuming too much CPU.) * */ @@ -74,11 +74,11 @@ class CTxMemPoolEntry // Information about descendants of this transaction that are in the // mempool; if we remove this transaction we must remove all of these // descendants as well. if nCountWithDescendants is 0, treat this entry as - // dirty, and nSizeWithDescendants and nFeesWithDescendants will not be + // dirty, and nSizeWithDescendants and nModFeesWithDescendants will not be // correct. uint64_t nCountWithDescendants; //! number of descendant transactions uint64_t nSizeWithDescendants; //! ... and size - CAmount nFeesWithDescendants; //! ... and total fees (all including us) + CAmount nModFeesWithDescendants; //! ... and total fees (all including us) public: CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, @@ -104,7 +104,8 @@ class CTxMemPoolEntry // Adjusts the descendant state, if this entry is not dirty. void UpdateState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount); - // Updates the fee delta used for mining priority score + // Updates the fee delta used for mining priority score, and the + // modified fees with descendants. void UpdateFeeDelta(int64_t feeDelta); /** We can set the entry to be dirty if doing the full calculation of in- @@ -116,7 +117,7 @@ class CTxMemPoolEntry uint64_t GetCountWithDescendants() const { return nCountWithDescendants; } uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; } - CAmount GetFeesWithDescendants() const { return nFeesWithDescendants; } + CAmount GetModFeesWithDescendants() const { return nModFeesWithDescendants; } bool GetSpendsCoinbase() const { return spendsCoinbase; } }; @@ -163,27 +164,27 @@ struct mempoolentry_txid } }; -/** \class CompareTxMemPoolEntryByFee +/** \class CompareTxMemPoolEntryByDescendantScore * - * Sort an entry by max(feerate of entry's tx, feerate with all descendants). + * Sort an entry by max(score/size of entry's tx, score/size with all descendants). */ -class CompareTxMemPoolEntryByFee +class CompareTxMemPoolEntryByDescendantScore { public: bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) { - bool fUseADescendants = UseDescendantFeeRate(a); - bool fUseBDescendants = UseDescendantFeeRate(b); + bool fUseADescendants = UseDescendantScore(a); + bool fUseBDescendants = UseDescendantScore(b); - double aFees = fUseADescendants ? a.GetFeesWithDescendants() : a.GetFee(); + double aModFee = fUseADescendants ? a.GetModFeesWithDescendants() : a.GetModifiedFee(); double aSize = fUseADescendants ? a.GetSizeWithDescendants() : a.GetTxSize(); - double bFees = fUseBDescendants ? b.GetFeesWithDescendants() : b.GetFee(); + double bModFee = fUseBDescendants ? b.GetModFeesWithDescendants() : b.GetModifiedFee(); double bSize = fUseBDescendants ? b.GetSizeWithDescendants() : b.GetTxSize(); // Avoid division by rewriting (a/b > c/d) as (a*d > c*b). - double f1 = aFees * bSize; - double f2 = aSize * bFees; + double f1 = aModFee * bSize; + double f2 = aSize * bModFee; if (f1 == f2) { return a.GetTime() >= b.GetTime(); @@ -191,11 +192,11 @@ class CompareTxMemPoolEntryByFee return f1 < f2; } - // Calculate which feerate to use for an entry (avoiding division). - bool UseDescendantFeeRate(const CTxMemPoolEntry &a) + // Calculate which score to use for an entry (avoiding division). + bool UseDescendantScore(const CTxMemPoolEntry &a) { - double f1 = (double)a.GetFee() * a.GetSizeWithDescendants(); - double f2 = (double)a.GetFeesWithDescendants() * a.GetTxSize(); + double f1 = (double)a.GetModifiedFee() * a.GetSizeWithDescendants(); + double f2 = (double)a.GetModFeesWithDescendants() * a.GetTxSize(); return f2 > f1; } }; @@ -350,7 +351,7 @@ class CTxMemPool // sorted by fee rate boost::multi_index::ordered_non_unique< boost::multi_index::identity, - CompareTxMemPoolEntryByFee + CompareTxMemPoolEntryByDescendantScore >, // sorted by entry time boost::multi_index::ordered_non_unique< diff --git a/src/ui_interface.h b/src/ui_interface.h index 00d9303124ed4..967d243270965 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2012 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/uint256.cpp b/src/uint256.cpp index 25148808c67ef..c58c88bf4a8f1 100644 --- a/src/uint256.cpp +++ b/src/uint256.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/uint256.h b/src/uint256.h index 6e37cd5d46f69..4495000f2fa9b 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/util.cpp b/src/util.cpp index 19131817125f0..019c912f5186f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/util.h b/src/util.h index fb154f6660d65..4d3c029e9aa00 100644 --- a/src/util.h +++ b/src/util.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utilmoneystr.cpp b/src/utilmoneystr.cpp index 0f3203432f6e1..bebe56130d1f6 100644 --- a/src/utilmoneystr.cpp +++ b/src/utilmoneystr.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utilmoneystr.h b/src/utilmoneystr.h index 99c3ba83061b7..5839b07344778 100644 --- a/src/utilmoneystr.h +++ b/src/utilmoneystr.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utilstrencodings.cpp b/src/utilstrencodings.cpp index c5a2b5cdbb780..130bc997ba96e 100644 --- a/src/utilstrencodings.cpp +++ b/src/utilstrencodings.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utilstrencodings.h b/src/utilstrencodings.h index ce93e8349779a..d40613cfc43bc 100644 --- a/src/utilstrencodings.h +++ b/src/utilstrencodings.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utiltime.cpp b/src/utiltime.cpp index 7d9f6210ebf76..91b40d9991106 100644 --- a/src/utiltime.cpp +++ b/src/utiltime.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/utiltime.h b/src/utiltime.h index 241b5211e9052..b2807267dbd5a 100644 --- a/src/utiltime.h +++ b/src/utiltime.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/validationinterface.h b/src/validationinterface.h index ffb56d266b958..4da145473b610 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/version.h b/src/version.h index f7cf18d0b68ca..d74e477580ba2 100644 --- a/src/version.h +++ b/src/version.h @@ -40,4 +40,7 @@ static const int NO_BLOOM_VERSION = 70011; //! "sendheaders" command and announcing blocks with headers starts with this version static const int SENDHEADERS_VERSION = 70012; +//! Version after which witness support potentially exists +static const int WITNESS_VERSION = 70012; + #endif // BITCOIN_VERSION_H diff --git a/src/wallet/crypter.cpp b/src/wallet/crypter.cpp index c86ad9758e42c..95aa4c2593164 100644 --- a/src/wallet/crypter.cpp +++ b/src/wallet/crypter.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/crypter.h b/src/wallet/crypter.h index 70aeb76723474..eb06a7866a96c 100644 --- a/src/wallet/crypter.h +++ b/src/wallet/crypter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp index 4b9dbebddd5ea..e5242d9725fd6 100644 --- a/src/wallet/db.cpp +++ b/src/wallet/db.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -224,7 +224,7 @@ void CDBEnv::CheckpointLSN(const std::string& strFile) } -CDB::CDB(const std::string& strFilename, const char* pszMode, bool fFlushOnCloseIn) : pdb(NULL), activeTxn(NULL) +CDB::CDB(const std::string& strFilename, const char* pszMode, bool fFlushOnCloseIn, int nSerVersionIn) : pdb(NULL), activeTxn(NULL), nSerVersion(nSerVersionIn) { int ret; fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w')); diff --git a/src/wallet/db.h b/src/wallet/db.h index 7f58d03f08c3a..ef1fff1be34f9 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -99,8 +99,9 @@ class CDB DbTxn* activeTxn; bool fReadOnly; bool fFlushOnClose; + int nSerVersion; - explicit CDB(const std::string& strFilename, const char* pszMode = "r+", bool fFlushOnCloseIn=true); + explicit CDB(const std::string& strFilename, const char* pszMode = "r+", bool fFlushOnCloseIn=true, int nSerVersion = CLIENT_VERSION); ~CDB() { Close(); } public: @@ -119,7 +120,7 @@ class CDB return false; // Key - CDataStream ssKey(SER_DISK, CLIENT_VERSION); + CDataStream ssKey(SER_DISK, nSerVersion); ssKey.reserve(1000); ssKey << key; Dbt datKey(&ssKey[0], ssKey.size()); @@ -134,7 +135,7 @@ class CDB // Unserialize value try { - CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION); + CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, nSerVersion); ssValue >> value; } catch (const std::exception&) { return false; @@ -155,13 +156,13 @@ class CDB assert(!"Write called on database in read-only mode"); // Key - CDataStream ssKey(SER_DISK, CLIENT_VERSION); + CDataStream ssKey(SER_DISK, nSerVersion); ssKey.reserve(1000); ssKey << key; Dbt datKey(&ssKey[0], ssKey.size()); // Value - CDataStream ssValue(SER_DISK, CLIENT_VERSION); + CDataStream ssValue(SER_DISK, nSerVersion); ssValue.reserve(10000); ssValue << value; Dbt datValue(&ssValue[0], ssValue.size()); @@ -184,7 +185,7 @@ class CDB assert(!"Erase called on database in read-only mode"); // Key - CDataStream ssKey(SER_DISK, CLIENT_VERSION); + CDataStream ssKey(SER_DISK, nSerVersion); ssKey.reserve(1000); ssKey << key; Dbt datKey(&ssKey[0], ssKey.size()); @@ -204,7 +205,7 @@ class CDB return false; // Key - CDataStream ssKey(SER_DISK, CLIENT_VERSION); + CDataStream ssKey(SER_DISK, nSerVersion); ssKey.reserve(1000); ssKey << key; Dbt datKey(&ssKey[0], ssKey.size()); diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index c431fc401311d..b025c37459fc3 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index db60e498dd281..9841cec595275 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -1083,6 +1083,80 @@ UniValue addmultisigaddress(const UniValue& params, bool fHelp) return CBitcoinAddress(innerID).ToString(); } +class Witnessifier : public boost::static_visitor +{ +public: + CScriptID result; + + bool operator()(const CNoDestination &dest) const { return false; } + + bool operator()(const CKeyID &keyID) { + CPubKey pubkey; + if (pwalletMain && pwalletMain->GetPubKey(keyID, pubkey)) { + CScript basescript; + basescript << ToByteVector(pubkey) << OP_CHECKSIG; + CScript hashscript; + hashscript << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG; + CScript witscript = GetScriptForWitness(basescript); + CScript hashwitscript = GetScriptForWitness(hashscript); + pwalletMain->AddCScript(basescript); + pwalletMain->AddCScript(witscript); + pwalletMain->AddCScript(hashwitscript); + result = CScriptID(witscript); + return true; + } + return false; + } + + bool operator()(const CScriptID &scriptID) { + CScript subscript; + if (pwalletMain && pwalletMain->GetCScript(scriptID, subscript)) { + int witnessversion; + std::vector witprog; + if (subscript.IsWitnessProgram(witnessversion, witprog)) { + result = scriptID; + return true; + } + CScript witscript = GetScriptForWitness(subscript); + pwalletMain->AddCScript(witscript); + result = CScriptID(witscript); + return true; + } + return false; + } +}; + +UniValue addwitnessaddress(const UniValue& params, bool fHelp) +{ + if (fHelp || params.size() < 1 || params.size() > 1) + { + string msg = "createwitnessaddress \"address\"\n" + "\nAdd a witness address for a script (with pubkey or redeemscript known).\n" + "It returns the witness script.\n" + + "\nArguments:\n" + "1. \"address\" (string, required) An address\n" + + "\nResult:\n" + "\"witnessaddress\", (string) The value of the new address (P2SH of witness script).\n" + "}\n" + ; + throw runtime_error(msg); + } + + CBitcoinAddress address(params[0].get_str()); + if (!address.IsValid()) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address"); + + Witnessifier w; + CTxDestination dest = address.Get(); + bool ret = boost::apply_visitor(w, dest); + if (!ret) { + throw JSONRPCError(RPC_WALLET_ERROR, "Public key or redeemscript not known to wallet"); + } + + return CBitcoinAddress(w.result).ToString(); +} struct tallyitem { diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp index 8b9292bd14d7f..f03cb4896cf03 100644 --- a/src/wallet/test/wallet_tests.cpp +++ b/src/wallet/test/wallet_tests.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2014 The Bitcoin Core developers +// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -328,4 +328,24 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests) empty_wallet(); } +BOOST_AUTO_TEST_CASE(pruning_in_ApproximateBestSet) +{ + CoinSet setCoinsRet; + CAmount nValueRet; + + LOCK(wallet.cs_wallet); + + empty_wallet(); + for (int i = 0; i < 100; i++) + add_coin(10 * CENT); + for (int i = 0; i < 100; i++) + add_coin(1000 * CENT); + + BOOST_CHECK(wallet.SelectCoinsMinConf(100001 * CENT, 1, 6, vCoins, setCoinsRet, nValueRet)); + // We need all 100 larger coins and exactly one small coin. + // Superfluous small coins must be pruned: + BOOST_CHECK_EQUAL(nValueRet, 100010 * CENT); + BOOST_CHECK_EQUAL(setCoinsRet.size(), 101); +} + BOOST_AUTO_TEST_SUITE_END() diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index d23d54e678780..6bda5015b1af4 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -1034,7 +1034,8 @@ void CWalletTx::GetAmounts(list& listReceived, // In either case, we need to get the destination address CTxDestination address; - if (!ExtractDestination(txout.scriptPubKey, address)) + + if (!ExtractDestination(txout.scriptPubKey, address) && !txout.scriptPubKey.IsUnspendable()) { LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", this->GetHash().ToString()); @@ -1359,6 +1360,15 @@ CAmount CWalletTx::GetChange() const return nChangeCached; } +bool CWalletTx::InMempool() const +{ + LOCK(mempool.cs); + if (mempool.exists(GetHash())) { + return true; + } + return false; +} + bool CWalletTx::IsTrusted() const { // Quick answer in most cases @@ -1373,12 +1383,8 @@ bool CWalletTx::IsTrusted() const return false; // Don't trust unconfirmed transactions from us unless they are in the mempool. - { - LOCK(mempool.cs); - if (!mempool.exists(GetHash())) { - return false; - } - } + if (!InMempool()) + return false; // Trusted if all inputs are from us and are in the mempool: BOOST_FOREACH(const CTxIn& txin, vin) @@ -1632,6 +1638,16 @@ static void ApproximateBestSubset(vector= nTargetValue ) + { + vfBest[i] = false; + nBest -= vValue[i].first; + } + } } bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, vector vCoins, @@ -2060,11 +2076,12 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt { bool signSuccess; const CScript& scriptPubKey = coin.first->vout[coin.second].scriptPubKey; - CScript& scriptSigRes = txNew.vin[nIn].scriptSig; - if (sign) - signSuccess = ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, SIGHASH_ALL), scriptPubKey, scriptSigRes); - else - signSuccess = ProduceSignature(DummySignatureCreator(this), scriptPubKey, scriptSigRes); + SignatureData sigdata; + if (sign) { + signSuccess = ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, coin.first->vout[coin.second].nValue, SIGHASH_ALL), scriptPubKey, sigdata); + UpdateTransaction(txNew, nIn, sigdata); + } else + signSuccess = ProduceSignature(DummySignatureCreator(this), scriptPubKey, sigdata); if (!signSuccess) { @@ -2074,12 +2091,13 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt nIn++; } - unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION); + unsigned int nBytes = GetVirtualTransactionSize(txNew); // Remove scriptSigs if we used dummy signatures for fee calculation if (!sign) { BOOST_FOREACH (CTxIn& vin, txNew.vin) vin.scriptSig = CScript(); + txNew.wit.SetNull(); } // Embed the constructed transaction data in wtxNew. diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 859788893c9d9..53a2b96690a0a 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -384,6 +384,7 @@ class CWalletTx : public CMerkleTx // True if only scriptSigs are different bool IsEquivalentTo(const CWalletTx& tx) const; + bool InMempool() const; bool IsTrusted() const; bool WriteToDisk(CWalletDB *pwalletdb); diff --git a/src/wallet/wallet_ismine.cpp b/src/wallet/wallet_ismine.cpp index d27b1531e3e62..e631efbb1555b 100644 --- a/src/wallet/wallet_ismine.cpp +++ b/src/wallet/wallet_ismine.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -72,6 +72,27 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) } break; } + case TX_WITNESS_V0: + { + isminetype ret = IsMine(keystore, CScript(vSolutions[0].begin(), vSolutions[0].end())); + if (ret == ISMINE_SPENDABLE) + return ret; + break; + } + case TX_WITNESS_V1: + { + uint160 hash; + CRIPEMD160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(hash.begin()); + CScriptID scriptID = CScriptID(hash); + CScript subscript; + if (keystore.GetCScript(scriptID, subscript)) { + isminetype ret = IsMine(keystore, subscript); + if (ret == ISMINE_SPENDABLE) + return ret; + } + break; + } + case TX_MULTISIG: { // Only consider transactions "mine" if we own ALL the @@ -88,8 +109,8 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) if (keystore.HaveWatchOnly(scriptPubKey)) { // TODO: This could be optimized some by doing some work after the above solver - CScript scriptSig; - return ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, scriptSig) ? ISMINE_WATCH_SOLVABLE : ISMINE_WATCH_UNSOLVABLE; + SignatureData sigs; + return ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, sigs) ? ISMINE_WATCH_SOLVABLE : ISMINE_WATCH_UNSOLVABLE; } return ISMINE_NO; } diff --git a/src/wallet/wallet_ismine.h b/src/wallet/wallet_ismine.h index 9f45f76c6b8c3..93cdf6ab8ff6d 100644 --- a/src/wallet/wallet_ismine.h +++ b/src/wallet/wallet_ismine.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index e2e827d816f3e..04652eb1dcc35 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -639,8 +639,8 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) while (true) { // Read next record - CDataStream ssKey(SER_DISK, CLIENT_VERSION); - CDataStream ssValue(SER_DISK, CLIENT_VERSION); + CDataStream ssKey(SER_DISK, nSerVersion); + CDataStream ssValue(SER_DISK, nSerVersion); int ret = ReadAtCursor(pcursor, ssKey, ssValue); if (ret == DB_NOTFOUND) break; @@ -745,8 +745,8 @@ DBErrors CWalletDB::FindWalletTx(CWallet* pwallet, vector& vTxHash, vec while (true) { // Read next record - CDataStream ssKey(SER_DISK, CLIENT_VERSION); - CDataStream ssValue(SER_DISK, CLIENT_VERSION); + CDataStream ssKey(SER_DISK, nSerVersion); + CDataStream ssValue(SER_DISK, nSerVersion); int ret = ReadAtCursor(pcursor, ssKey, ssValue); if (ret == DB_NOTFOUND) break; diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index 77f7958814ef3..160bca6cba1f3 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -1,5 +1,5 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto -// Copyright (c) 2009-2013 The Bitcoin Core developers +// Copyright (c) 2009-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -7,6 +7,7 @@ #define BITCOIN_WALLET_WALLETDB_H #include "amount.h" +#include "primitives/transaction.h" #include "wallet/db.h" #include "key.h" @@ -77,7 +78,7 @@ class CKeyMetadata class CWalletDB : public CDB { public: - CWalletDB(const std::string& strFilename, const char* pszMode = "r+", bool fFlushOnClose = true) : CDB(strFilename, pszMode, fFlushOnClose) + CWalletDB(const std::string& strFilename, const char* pszMode = "r+", bool fFlushOnClose = true) : CDB(strFilename, pszMode, fFlushOnClose, CLIENT_VERSION | SERIALIZE_TRANSACTION_WITNESS) { }