mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-22 00:00:55 +01:00
Compare commits
16 Commits
v25.1
...
v0.11.0rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32b011781d | ||
|
|
2edec4fe68 | ||
|
|
304892fc03 | ||
|
|
666e973b2f | ||
|
|
7a4304ecc7 | ||
|
|
ecdcf13ede | ||
|
|
5901596548 | ||
|
|
6145fdf47e | ||
|
|
4d435d1c9a | ||
|
|
7d4b5cbee3 | ||
|
|
c00ae64f77 | ||
|
|
dfdb6dd052 | ||
|
|
b4bbad18ef | ||
|
|
75a4d512cf | ||
|
|
2be094eeba | ||
|
|
8e15efa76c |
13
Makefile.am
13
Makefile.am
@@ -14,11 +14,12 @@ BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT)
|
||||
BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-cli$(EXEEXT)
|
||||
BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
|
||||
|
||||
OSX_APP=Bitcoin-Core.app
|
||||
OSX_APP=Bitcoin-Qt.app
|
||||
OSX_DMG=Bitcoin-Core.dmg
|
||||
OSX_BACKGROUND_IMAGE=background.tiff
|
||||
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
|
||||
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
|
||||
OSX_BASE_LPROJ_DIR=$(top_srcdir)/contrib/macdeploy/Base.lproj/InfoPlist.strings
|
||||
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
|
||||
OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
|
||||
OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
|
||||
@@ -30,7 +31,7 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
|
||||
$(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
|
||||
$(top_srcdir)/doc/README_windows.txt
|
||||
|
||||
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
|
||||
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \
|
||||
$(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
|
||||
$(top_srcdir)/contrib/macdeploy/DS_Store \
|
||||
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
|
||||
@@ -72,7 +73,7 @@ $(OSX_APP)/Contents/PkgInfo:
|
||||
|
||||
$(OSX_APP)/Contents/Resources/empty.lproj:
|
||||
$(MKDIR_P) $(@D)
|
||||
@touch $@
|
||||
@touch $@
|
||||
|
||||
$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
|
||||
$(MKDIR_P) $(@D)
|
||||
@@ -86,9 +87,13 @@ $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
|
||||
$(MKDIR_P) $(@D)
|
||||
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
|
||||
|
||||
$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR)
|
||||
$(MKDIR_P) $(@D)
|
||||
$(INSTALL_DATA) $< $@
|
||||
|
||||
OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
|
||||
$(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
|
||||
$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
|
||||
$(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
|
||||
|
||||
if BUILD_DARWIN
|
||||
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
|
||||
AC_PREREQ([2.60])
|
||||
define(_CLIENT_VERSION_MAJOR, 0)
|
||||
define(_CLIENT_VERSION_MINOR, 10)
|
||||
define(_CLIENT_VERSION_REVISION, 99)
|
||||
define(_CLIENT_VERSION_MINOR, 11)
|
||||
define(_CLIENT_VERSION_REVISION, 0)
|
||||
define(_CLIENT_VERSION_BUILD, 0)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, false)
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2015)
|
||||
AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin])
|
||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
@@ -885,7 +885,7 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
|
||||
unset PKG_CONFIG_LIBDIR
|
||||
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
|
||||
|
||||
ac_configure_args="${ac_configure_args} --disable-shared --with-pic"
|
||||
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no"
|
||||
AC_CONFIG_SUBDIRS([src/secp256k1])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "bitcoin-linux-0.10"
|
||||
name: "bitcoin-linux-0.11"
|
||||
enable_cache: true
|
||||
suites:
|
||||
- "precise"
|
||||
@@ -16,7 +16,7 @@ packages:
|
||||
- "bsdmainutils"
|
||||
- "binutils-gold"
|
||||
- "libstdc++6-4.6-pic"
|
||||
reference_datetime: "2013-06-01 00:00:00"
|
||||
reference_datetime: "2015-06-01 00:00:00"
|
||||
remotes:
|
||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
||||
"dir": "bitcoin"
|
||||
|
||||
@@ -7,7 +7,7 @@ architectures:
|
||||
packages:
|
||||
- "libc6:i386"
|
||||
- "faketime"
|
||||
reference_datetime: "2013-06-01 00:00:00"
|
||||
reference_datetime: "2015-06-01 00:00:00"
|
||||
remotes: []
|
||||
files:
|
||||
- "bitcoin-osx-unsigned.tar.gz"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "bitcoin-osx-0.10"
|
||||
name: "bitcoin-osx-0.11"
|
||||
enable_cache: true
|
||||
suites:
|
||||
- "precise"
|
||||
@@ -18,7 +18,7 @@ packages:
|
||||
- "libcap-dev"
|
||||
- "libz-dev"
|
||||
- "libbz2-dev"
|
||||
reference_datetime: "2013-06-01 00:00:00"
|
||||
reference_datetime: "2015-06-01 00:00:00"
|
||||
remotes:
|
||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
||||
"dir": "bitcoin"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: "bitcoin-win-0.10"
|
||||
name: "bitcoin-win-0.11"
|
||||
enable_cache: true
|
||||
suites:
|
||||
- "precise"
|
||||
@@ -18,7 +18,7 @@ packages:
|
||||
- "g++-mingw-w64"
|
||||
- "nsis"
|
||||
- "zip"
|
||||
reference_datetime: "2013-06-01 00:00:00"
|
||||
reference_datetime: "2015-06-01 00:00:00"
|
||||
remotes:
|
||||
- "url": "https://github.com/bitcoin/bitcoin.git"
|
||||
"dir": "bitcoin"
|
||||
|
||||
1
contrib/macdeploy/Base.lproj/InfoPlist.strings
Normal file
1
contrib/macdeploy/Base.lproj/InfoPlist.strings
Normal file
@@ -0,0 +1 @@
|
||||
{ CFBundleDisplayName = "Bitcoin Core"; CFBundleName = "Bitcoin Core"; }
|
||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
set -e
|
||||
|
||||
ROOTDIR=dist
|
||||
BUNDLE="${ROOTDIR}/Bitcoin Core.app"
|
||||
BUNDLE="${ROOTDIR}/Bitcoin-Qt.app"
|
||||
CODESIGN=codesign
|
||||
TEMPDIR=sign.temp
|
||||
TEMPLIST=${TEMPDIR}/signatures.txt
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<integer>370</integer>
|
||||
<integer>156</integer>
|
||||
</array>
|
||||
<key>Bitcoin Core.app</key>
|
||||
<key>Bitcoin-Qt.app</key>
|
||||
<array>
|
||||
<integer>128</integer>
|
||||
<integer>156</integer>
|
||||
|
||||
@@ -596,7 +596,7 @@ if os.path.exists("dist"):
|
||||
|
||||
# ------------------------------------------------
|
||||
|
||||
target = os.path.join("dist", "Bitcoin Core.app")
|
||||
target = os.path.join("dist", "Bitcoin-Qt.app")
|
||||
|
||||
if verbose >= 2:
|
||||
print "+ Copying source bundle +"
|
||||
@@ -757,7 +757,7 @@ if config.dmg is not None:
|
||||
|
||||
if fancy is None:
|
||||
try:
|
||||
runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname=app_bundle_name, ov=True)
|
||||
runHDIUtil("create", dmg_name, srcfolder="dist", format="UDBZ", volname="Bitcoin-Core", ov=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
sys.exit(e.returncode)
|
||||
else:
|
||||
@@ -772,7 +772,7 @@ if config.dmg is not None:
|
||||
if verbose >= 3:
|
||||
print "Creating temp image for modification..."
|
||||
try:
|
||||
runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname=app_bundle_name, ov=True)
|
||||
runHDIUtil("create", dmg_name + ".temp", srcfolder="dist", format="UDRW", size=size, volname="Bitcoin-Core", ov=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
sys.exit(e.returncode)
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ PROJECT_NAME = Bitcoin
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = 0.10.99
|
||||
PROJECT_NUMBER = 0.11.0
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Bitcoin Core 0.10.99
|
||||
Bitcoin Core 0.11.0
|
||||
=====================
|
||||
|
||||
Setup
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Bitcoin Core 0.10.99
|
||||
Bitcoin Core 0.11.0
|
||||
=====================
|
||||
|
||||
Intro
|
||||
|
||||
@@ -100,7 +100,7 @@ Creating a release build
|
||||
------------------------
|
||||
You can ignore this section if you are building `bitcoind` for your own use.
|
||||
|
||||
bitcoind/bitcoin-cli binaries are not included in the Bitcoin-Core.app bundle.
|
||||
bitcoind/bitcoin-cli binaries are not included in the Bitcoin-Qt.app bundle.
|
||||
|
||||
If you are building `bitcoind` or `Bitcoin-Qt` for others, your build machine should be set up
|
||||
as follows for maximum compatibility:
|
||||
@@ -111,7 +111,7 @@ All dependencies should be compiled with these flags:
|
||||
-arch x86_64
|
||||
-isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk
|
||||
|
||||
Once dependencies are compiled, see [doc/release-process.md](release-process.md) for how the Bitcoin-Core.app
|
||||
Once dependencies are compiled, see [doc/release-process.md](release-process.md) for how the Bitcoin-Qt.app
|
||||
bundle is packaged and signed to create the .dmg disk image that is distributed.
|
||||
|
||||
Running
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
(note: this is a temporary file, to be added-to by anybody, and moved to
|
||||
release-notes at release time)
|
||||
Bitcoin Core version 0.11.0 is now available from:
|
||||
|
||||
<https://bitcoin.org/bin/bitcoin-core-0.11.0/>
|
||||
|
||||
This is a new major version release, bringing both new features and
|
||||
bug fixes.
|
||||
|
||||
Please report bugs using the issue tracker at github:
|
||||
|
||||
<https://github.com/bitcoin/bitcoin/issues>
|
||||
|
||||
Upgrading and downgrading
|
||||
=========================
|
||||
|
||||
How to Upgrade
|
||||
--------------
|
||||
|
||||
If you are running an older version, shut it down. Wait until it has completely
|
||||
shut down (which might take a few minutes for older versions), then run the
|
||||
installer (on Windows) or just copy over /Applications/Bitcoin-Qt (on Mac) or
|
||||
bitcoind/bitcoin-qt (on Linux).
|
||||
|
||||
Downgrade warning
|
||||
------------------
|
||||
|
||||
Because release 0.10.0 and later makes use of headers-first synchronization and
|
||||
parallel block download (see further), the block files and databases are not
|
||||
backwards-compatible with pre-0.10 versions of Bitcoin Core or other software:
|
||||
|
||||
* Blocks will be stored on disk out of order (in the order they are
|
||||
received, really), which makes it incompatible with some tools or
|
||||
other programs. Reindexing using earlier versions will also not work
|
||||
anymore as a result of this.
|
||||
|
||||
* The block index database will now hold headers for which no block is
|
||||
stored on disk, which earlier versions won't support.
|
||||
|
||||
If you want to be able to downgrade smoothly, make a backup of your entire data
|
||||
directory. Without this your node will need start syncing (or importing from
|
||||
bootstrap.dat) anew afterwards. It is possible that the data from a completely
|
||||
synchronised 0.10 node may be usable in older versions as-is, but this is not
|
||||
supported and may break as soon as the older version attempts to reindex.
|
||||
|
||||
This does not affect wallet forward or backward compatibility. There are no
|
||||
known problems when downgrading from 0.11.x to 0.10.x.
|
||||
|
||||
Notable changes
|
||||
===============
|
||||
@@ -71,7 +114,8 @@ Big endian support
|
||||
--------------------
|
||||
|
||||
Experimental support for big-endian CPU architectures was added in this
|
||||
release. This has been tested on at least MIPS and PPC hosts. The build
|
||||
release. All little-endian specific code was replaced with endian-neutral
|
||||
constructs. This has been tested on at least MIPS and PPC hosts. The build
|
||||
system will automatically detect the endianness of the target.
|
||||
|
||||
Memory usage optimization
|
||||
@@ -121,7 +165,7 @@ network. This improves connection reliability as well as privacy, especially
|
||||
for the initial connections.
|
||||
|
||||
**Important note:** If a non-Tor SOCKS5 proxy is configured that supports
|
||||
authentication, but doesn't require it, this change may cause it to reject
|
||||
authentication, but doesn't require it, this change may cause that proxy to reject
|
||||
connections. A user and password is sent where they weren't before. This setup
|
||||
is exceedingly rare, but in this case `-proxyrandomize=0` can be passed to
|
||||
disable the behavior.
|
||||
@@ -151,6 +195,8 @@ git merge commit are mentioned.
|
||||
- #5418 `16341cc` Report missing inputs in sendrawtransaction
|
||||
- #5937 `40f5e8d` show script verification errors in signrawtransaction result
|
||||
- #5420 `1fd2d39` getutxos REST command (based on Bip64)
|
||||
- #6193 `42746b0` [REST] remove json input for getutxos, limit to query max. 15 outpoints
|
||||
- #6226 `5901596` json: fail read_string if string contains trailing garbage
|
||||
|
||||
### Configuration and command-line options
|
||||
- #5636 `a353ad4` Add option `-allowselfsignedrootcertificate` to allow self signed root certs (for testing payment requests)
|
||||
@@ -158,6 +204,7 @@ git merge commit are mentioned.
|
||||
- #5951 `7efc9cf` Make it possible to disable wallet transaction broadcast (using `-walletbroadcast=0`)
|
||||
- #5911 `b6ea3bc` privacy: Stream isolation for Tor (on by default, use `-proxyrandomize=0` to disable)
|
||||
- #5863 `c271304` Add autoprune functionality (`-prune=<size>`)
|
||||
- #6153 `0bcf04f` Parameter interaction: disable upnp if -proxy set
|
||||
|
||||
### Block and transaction handling
|
||||
- #5367 `dcc1304` Do all block index writes in a batch
|
||||
@@ -178,6 +225,7 @@ git merge commit are mentioned.
|
||||
- #6102 `6fb90d8` Implement accurate UTXO cache size accounting
|
||||
- #6129 `2a82298` Bug fix for clearing fCheckForPruning
|
||||
- #5947 `e9af4e6` Alert if it is very likely we are getting a bad chain
|
||||
- #6203 `c00ae64` Remove P2SH coinbase flag, no longer interesting
|
||||
|
||||
### P2P protocol and network code
|
||||
- #5507 `844ace9` Prevent DOS attacks on in-flight data structures
|
||||
@@ -191,6 +239,8 @@ git merge commit are mentioned.
|
||||
- #6059 `f026ab6` chainparams: use SeedSpec6's rather than CAddress's for fixed seeds
|
||||
- #6080 `31c0bf1` Add jonasschnellis dns seeder
|
||||
- #5976 `9f7809f` Reduce download timeouts as blocks arrive
|
||||
- #6172 `b4bbad1` Ignore getheaders requests when not synced
|
||||
- #5875 `304892f` Be stricter in processing unrequested blocks
|
||||
|
||||
### Validation
|
||||
- #5143 `48e1765` Implement BIP62 rule 6
|
||||
@@ -220,6 +270,7 @@ git merge commit are mentioned.
|
||||
- #6076 `6c97fd1` wallet: fix boost::get usage with boost 1.58
|
||||
- #5511 `23c998d` Sort pending wallet transactions before reaccepting
|
||||
- #6126 `26e08a1` Change default nTxConfirmTarget to 2
|
||||
- #6183 `75a4d51` Fix off-by-one error w/ nLockTime in the wallet
|
||||
|
||||
### GUI
|
||||
- #5219 `f3af0c8` New icons
|
||||
@@ -299,5 +350,92 @@ git merge commit are mentioned.
|
||||
- #6168 `b3024f0` contrib/linearize: Support linearization of testnet blocks
|
||||
- #6098 `7708fcd` Update Windows resource files (and add one for bitcoin-tx)
|
||||
- #6159 `e1412d3` Catch errors on datadir lock and pidfile delete
|
||||
- #6186 `182686c` Fix two problems in CSubnet parsing
|
||||
- #6174 `df992b9` doc: add translation strings policy
|
||||
- #6210 `dfdb6dd` build: disable optional use of gmp in internal secp256k1 build
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Thanks to everyone who directly contributed to this release:
|
||||
|
||||
- 21E14
|
||||
- Adam Weiss
|
||||
- Alex Morcos
|
||||
- ayeowch
|
||||
- azeteki
|
||||
- Ben Holden-Crowther
|
||||
- bikinibabe
|
||||
- BitcoinPRReadingGroup
|
||||
- Blake Jakopovic
|
||||
- BtcDrak
|
||||
- charlescharles
|
||||
- Chris Arnesen
|
||||
- Ciemon
|
||||
- CohibAA
|
||||
- Corinne Dashjr
|
||||
- Cory Fields
|
||||
- Cozz Lovan
|
||||
- Daira Hopwood
|
||||
- Daniel Kraft
|
||||
- Dave Collins
|
||||
- David A. Harding
|
||||
- dexX7
|
||||
- Earlz
|
||||
- Eric Lombrozo
|
||||
- Eric R. Schulz
|
||||
- Everett Forth
|
||||
- Flavien Charlon
|
||||
- fsb4000
|
||||
- Gavin Andresen
|
||||
- Gregory Maxwell
|
||||
- Heath
|
||||
- Ivan Pustogarov
|
||||
- Jameson Lopp
|
||||
- Jason Lewicki
|
||||
- Jeff Garzik
|
||||
- Jonas Schnelli
|
||||
- Jonathan Brown
|
||||
- Jorge Timón
|
||||
- joshr
|
||||
- jtimon
|
||||
- Julian Yap
|
||||
- Luca Venturini
|
||||
- Luke Dashjr
|
||||
- Manuel Araoz
|
||||
- MarcoFalke
|
||||
- Matt Bogosian
|
||||
- Matt Corallo
|
||||
- Micha
|
||||
- Michael Ford
|
||||
- Mike Hearn
|
||||
- mrbandrews
|
||||
- Nicolas Benoit
|
||||
- paveljanik
|
||||
- Pavel Janík
|
||||
- Pavel Vasin
|
||||
- Peter Todd
|
||||
- Philip Kaufmann
|
||||
- Pieter Wuille
|
||||
- pstratem
|
||||
- randy-waterhouse
|
||||
- Rob Van Mieghem
|
||||
- Ross Nicoll
|
||||
- Ruben de Vries
|
||||
- sandakersmann
|
||||
- Shaul Kfir
|
||||
- Shawn Wilkinson
|
||||
- sinetek
|
||||
- Suhas Daftuar
|
||||
- svost
|
||||
- Thomas Zander
|
||||
- UdjinM6
|
||||
- Vitalii Demianets
|
||||
- Wladimir J. van der Laan
|
||||
|
||||
And all those who contributed additional code review and/or security research:
|
||||
|
||||
- Sergio Demian Lerner
|
||||
|
||||
As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/bitcoin/).
|
||||
|
||||
[up to date until #5976]
|
||||
|
||||
@@ -51,6 +51,7 @@ testScriptsExt=(
|
||||
'invalidblockrequest.py'
|
||||
'rawtransactions.py'
|
||||
# 'forknotify.py'
|
||||
'p2p-acceptblock.py'
|
||||
);
|
||||
|
||||
extArg="-extended"
|
||||
|
||||
226
qa/rpc-tests/p2p-acceptblock.py
Executable file
226
qa/rpc-tests/p2p-acceptblock.py
Executable file
@@ -0,0 +1,226 @@
|
||||
#!/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.mininode import *
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import *
|
||||
import time
|
||||
from test_framework.blocktools import create_block, create_coinbase
|
||||
|
||||
'''
|
||||
AcceptBlockTest -- test processing of unrequested blocks.
|
||||
|
||||
Since behavior differs when receiving unrequested blocks from whitelisted peers
|
||||
versus non-whitelisted peers, this tests the behavior of both (effectively two
|
||||
separate tests running in parallel).
|
||||
|
||||
Setup: two nodes, node0 and node1, not connected to each other. Node0 does not
|
||||
whitelist localhost, but node1 does. They will each be on their own chain for
|
||||
this test.
|
||||
|
||||
We have one NodeConn connection to each, test_node and white_node respectively.
|
||||
|
||||
The test:
|
||||
1. Generate one block on each node, to leave IBD.
|
||||
|
||||
2. Mine a new block on each tip, and deliver to each node from node's peer.
|
||||
The tip should advance.
|
||||
|
||||
3. Mine a block that forks the previous block, and deliver to each node from
|
||||
corresponding peer.
|
||||
Node0 should not process this block (just accept the header), because it is
|
||||
unrequested and doesn't have more work than the tip.
|
||||
Node1 should process because this is coming from a whitelisted peer.
|
||||
|
||||
4. Send another block that builds on the forking block.
|
||||
Node0 should process this block but be stuck on the shorter chain, because
|
||||
it's missing an intermediate block.
|
||||
Node1 should reorg to this longer chain.
|
||||
|
||||
5. Send a duplicate of the block in #3 to Node0.
|
||||
Node0 should not process the block because it is unrequested, and stay on
|
||||
the shorter chain.
|
||||
|
||||
6. Send Node0 an inv for the height 3 block produced in #4 above.
|
||||
Node0 should figure out that Node0 has the missing height 2 block and send a
|
||||
getdata.
|
||||
|
||||
7. Send Node0 the missing block again.
|
||||
Node0 should process and the tip should advance.
|
||||
'''
|
||||
|
||||
# TestNode: bare-bones "peer". Used mostly as a conduit for a test to sending
|
||||
# p2p messages to a node, generating the messages in the main testing logic.
|
||||
class TestNode(NodeConnCB):
|
||||
def __init__(self):
|
||||
NodeConnCB.__init__(self)
|
||||
self.create_callback_map()
|
||||
self.connection = None
|
||||
|
||||
def add_connection(self, conn):
|
||||
self.connection = conn
|
||||
|
||||
# Track the last getdata message we receive (used in the test)
|
||||
def on_getdata(self, conn, message):
|
||||
self.last_getdata = message
|
||||
|
||||
# Spin until verack message is received from the node.
|
||||
# We use this to signal that our test can begin. This
|
||||
# is called from the testing thread, so it needs to acquire
|
||||
# the global lock.
|
||||
def wait_for_verack(self):
|
||||
while True:
|
||||
with mininode_lock:
|
||||
if self.verack_received:
|
||||
return
|
||||
time.sleep(0.05)
|
||||
|
||||
# Wrapper for the NodeConn's send_message function
|
||||
def send_message(self, message):
|
||||
self.connection.send_message(message)
|
||||
|
||||
class AcceptBlockTest(BitcoinTestFramework):
|
||||
def add_options(self, parser):
|
||||
parser.add_option("--testbinary", dest="testbinary",
|
||||
default=os.getenv("BITCOIND", "bitcoind"),
|
||||
help="bitcoind binary to test")
|
||||
|
||||
def setup_chain(self):
|
||||
initialize_chain_clean(self.options.tmpdir, 2)
|
||||
|
||||
def setup_network(self):
|
||||
# Node0 will be used to test behavior of processing unrequested blocks
|
||||
# from peers which are not whitelisted, while Node1 will be used for
|
||||
# the whitelisted case.
|
||||
self.nodes = []
|
||||
self.nodes.append(start_node(0, self.options.tmpdir, ["-debug"],
|
||||
binary=self.options.testbinary))
|
||||
self.nodes.append(start_node(1, self.options.tmpdir,
|
||||
["-debug", "-whitelist=127.0.0.1"],
|
||||
binary=self.options.testbinary))
|
||||
|
||||
def run_test(self):
|
||||
# Setup the p2p connections and start up the network thread.
|
||||
test_node = TestNode() # connects to node0 (not whitelisted)
|
||||
white_node = TestNode() # connects to node1 (whitelisted)
|
||||
|
||||
connections = []
|
||||
connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], test_node))
|
||||
connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1], white_node))
|
||||
test_node.add_connection(connections[0])
|
||||
white_node.add_connection(connections[1])
|
||||
|
||||
NetworkThread().start() # Start up network handling in another thread
|
||||
|
||||
# Test logic begins here
|
||||
test_node.wait_for_verack()
|
||||
white_node.wait_for_verack()
|
||||
|
||||
# 1. Have both nodes mine a block (leave IBD)
|
||||
[ n.generate(1) for n in self.nodes ]
|
||||
tips = [ int ("0x" + n.getbestblockhash() + "L", 0) for n in self.nodes ]
|
||||
|
||||
# 2. Send one block that builds on each tip.
|
||||
# This should be accepted.
|
||||
blocks_h2 = [] # the height 2 blocks on each node's chain
|
||||
for i in xrange(2):
|
||||
blocks_h2.append(create_block(tips[i], create_coinbase(), time.time()+1))
|
||||
blocks_h2[i].solve()
|
||||
test_node.send_message(msg_block(blocks_h2[0]))
|
||||
white_node.send_message(msg_block(blocks_h2[1]))
|
||||
|
||||
time.sleep(1)
|
||||
assert_equal(self.nodes[0].getblockcount(), 2)
|
||||
assert_equal(self.nodes[1].getblockcount(), 2)
|
||||
print "First height 2 block accepted by both nodes"
|
||||
|
||||
# 3. Send another block that builds on the original tip.
|
||||
blocks_h2f = [] # Blocks at height 2 that fork off the main chain
|
||||
for i in xrange(2):
|
||||
blocks_h2f.append(create_block(tips[i], create_coinbase(), blocks_h2[i].nTime+1))
|
||||
blocks_h2f[i].solve()
|
||||
test_node.send_message(msg_block(blocks_h2f[0]))
|
||||
white_node.send_message(msg_block(blocks_h2f[1]))
|
||||
|
||||
time.sleep(1) # Give time to process the block
|
||||
for x in self.nodes[0].getchaintips():
|
||||
if x['hash'] == blocks_h2f[0].hash:
|
||||
assert_equal(x['status'], "headers-only")
|
||||
|
||||
for x in self.nodes[1].getchaintips():
|
||||
if x['hash'] == blocks_h2f[1].hash:
|
||||
assert_equal(x['status'], "valid-headers")
|
||||
|
||||
print "Second height 2 block accepted only from whitelisted peer"
|
||||
|
||||
# 4. Now send another block that builds on the forking chain.
|
||||
blocks_h3 = []
|
||||
for i in xrange(2):
|
||||
blocks_h3.append(create_block(blocks_h2f[i].sha256, create_coinbase(), blocks_h2f[i].nTime+1))
|
||||
blocks_h3[i].solve()
|
||||
test_node.send_message(msg_block(blocks_h3[0]))
|
||||
white_node.send_message(msg_block(blocks_h3[1]))
|
||||
|
||||
time.sleep(1)
|
||||
# Since the earlier block was not processed by node0, the new block
|
||||
# can't be fully validated.
|
||||
for x in self.nodes[0].getchaintips():
|
||||
if x['hash'] == blocks_h3[0].hash:
|
||||
assert_equal(x['status'], "headers-only")
|
||||
|
||||
# But this block should be accepted by node0 since it has more work.
|
||||
try:
|
||||
self.nodes[0].getblock(blocks_h3[0].hash)
|
||||
print "Unrequested more-work block accepted from non-whitelisted peer"
|
||||
except:
|
||||
raise AssertionError("Unrequested more work block was not processed")
|
||||
|
||||
# Node1 should have accepted and reorged.
|
||||
assert_equal(self.nodes[1].getblockcount(), 3)
|
||||
print "Successfully reorged to length 3 chain from whitelisted peer"
|
||||
|
||||
# 5. Test handling of unrequested block on the node that didn't process
|
||||
# Should still not be processed (even though it has a child that has more
|
||||
# work).
|
||||
test_node.send_message(msg_block(blocks_h2f[0]))
|
||||
|
||||
# Here, if the sleep is too short, the test could falsely succeed (if the
|
||||
# node hasn't processed the block by the time the sleep returns, and then
|
||||
# the node processes it and incorrectly advances the tip).
|
||||
# But this would be caught later on, when we verify that an inv triggers
|
||||
# a getdata request for this block.
|
||||
time.sleep(1)
|
||||
assert_equal(self.nodes[0].getblockcount(), 2)
|
||||
print "Unrequested block that would complete more-work chain was ignored"
|
||||
|
||||
# 6. Try to get node to request the missing block.
|
||||
# Poke the node with an inv for block at height 3 and see if that
|
||||
# triggers a getdata on block 2 (it should if block 2 is missing).
|
||||
with mininode_lock:
|
||||
# Clear state so we can check the getdata request
|
||||
test_node.last_getdata = None
|
||||
test_node.send_message(msg_inv([CInv(2, blocks_h3[0].sha256)]))
|
||||
|
||||
time.sleep(1)
|
||||
with mininode_lock:
|
||||
getdata = test_node.last_getdata
|
||||
|
||||
# Check that the getdata is for the right block
|
||||
assert_equal(len(getdata.inv), 1)
|
||||
assert_equal(getdata.inv[0].hash, blocks_h2f[0].sha256)
|
||||
print "Inv at tip triggered getdata for unprocessed block"
|
||||
|
||||
# 7. Send the missing block for the third time (now it is requested)
|
||||
test_node.send_message(msg_block(blocks_h2f[0]))
|
||||
|
||||
time.sleep(1)
|
||||
assert_equal(self.nodes[0].getblockcount(), 3)
|
||||
print "Successfully reorged to length 3 chain from non-whitelisted peer"
|
||||
|
||||
[ c.disconnect_node() for c in connections ]
|
||||
|
||||
if __name__ == '__main__':
|
||||
AcceptBlockTest().main()
|
||||
@@ -7,7 +7,7 @@ signing requests.
|
||||
|
||||
For OSX, the private key was generated by Keychain.app on Gavin's main work machine.
|
||||
The key and certificate is in a separate, passphrase-protected keychain file that is
|
||||
unlocked to sign the Bitcoin-Core.app bundle.
|
||||
unlocked to sign the Bitcoin-Qt.app bundle.
|
||||
|
||||
For Windows, the private key was generated by Firefox running on Gavin's main work machine.
|
||||
The key and certificate were exported into a separate, passphrase-protected PKCS#12 file, and
|
||||
@@ -17,7 +17,7 @@ Threat analysis
|
||||
--
|
||||
|
||||
Gavin is a single point of failure. He could be coerced to divulge the secret signing keys,
|
||||
allowing somebody to distribute a Bitcoin-Core.app or bitcoin-qt-setup.exe with a valid
|
||||
allowing somebody to distribute a Bitcoin-Qt.app or bitcoin-qt-setup.exe with a valid
|
||||
signature but containing a malicious binary.
|
||||
|
||||
Or the machine Gavin uses to sign the binaries could be compromised, either remotely or
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<plist version="0.9">
|
||||
<dict>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.6.0</string>
|
||||
<string>10.7.0</string>
|
||||
|
||||
<key>LSArchitecturePriority</key>
|
||||
<array>
|
||||
@@ -30,6 +30,12 @@
|
||||
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Bitcoin-Qt</string>
|
||||
|
||||
<key>CFBundleName</key>
|
||||
<string>Bitcoin-Qt</string>
|
||||
|
||||
<key>LSHasLocalizedDisplayName</key>
|
||||
<true/>
|
||||
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.bitcoinfoundation.Bitcoin-Qt</string>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
//! 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 10
|
||||
#define CLIENT_VERSION_REVISION 99
|
||||
#define CLIENT_VERSION_MINOR 11
|
||||
#define CLIENT_VERSION_REVISION 0
|
||||
#define CLIENT_VERSION_BUILD 0
|
||||
|
||||
//! Set to true for release, false for prerelease or test build
|
||||
#define CLIENT_VERSION_IS_RELEASE false
|
||||
#define CLIENT_VERSION_IS_RELEASE true
|
||||
|
||||
/**
|
||||
* Copyright year (2009-this)
|
||||
|
||||
@@ -787,12 +787,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
if (nConnectTimeout <= 0)
|
||||
nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;
|
||||
|
||||
// Continue to put "/P2SH/" in the coinbase to monitor
|
||||
// BIP16 support.
|
||||
// This can be removed eventually...
|
||||
const char* pszP2SH = "/P2SH/";
|
||||
COINBASE_FLAGS << std::vector<unsigned char>(pszP2SH, pszP2SH+strlen(pszP2SH));
|
||||
|
||||
// Fee-per-kilobyte amount considered the same as "free"
|
||||
// If you are mining, be careful setting this:
|
||||
// if you set it to zero then
|
||||
|
||||
@@ -521,12 +521,11 @@ namespace json_spirit
|
||||
|
||||
const spirit_namespace::parse_info< Iter_type > info =
|
||||
spirit_namespace::parse( begin, end,
|
||||
Json_grammer< Value_type, Iter_type >( semantic_actions ),
|
||||
Json_grammer< Value_type, Iter_type >( semantic_actions ) >> spirit_namespace::end_p,
|
||||
spirit_namespace::space_p );
|
||||
|
||||
if( !info.hit )
|
||||
{
|
||||
assert( false ); // in theory exception should already have been thrown
|
||||
throw_error( info.stop, "error" );
|
||||
}
|
||||
|
||||
@@ -570,7 +569,8 @@ namespace json_spirit
|
||||
{
|
||||
typename String_type::const_iterator begin = s.begin();
|
||||
|
||||
return read_range( begin, s.end(), value );
|
||||
bool success = read_range( begin, s.end(), value );
|
||||
return success && begin == s.end();
|
||||
}
|
||||
|
||||
template< class Istream_type >
|
||||
|
||||
72
src/main.cpp
72
src/main.cpp
@@ -296,7 +296,8 @@ void FinalizeNode(NodeId nodeid) {
|
||||
}
|
||||
|
||||
// Requires cs_main.
|
||||
void MarkBlockAsReceived(const uint256& hash) {
|
||||
// Returns a bool indicating whether we requested this block.
|
||||
bool MarkBlockAsReceived(const uint256& hash) {
|
||||
map<uint256, pair<NodeId, list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash);
|
||||
if (itInFlight != mapBlocksInFlight.end()) {
|
||||
CNodeState *state = State(itInFlight->second.first);
|
||||
@@ -306,7 +307,9 @@ void MarkBlockAsReceived(const uint256& hash) {
|
||||
state->nBlocksInFlight--;
|
||||
state->nStallingSince = 0;
|
||||
mapBlocksInFlight.erase(itInFlight);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Requires cs_main.
|
||||
@@ -671,14 +674,8 @@ bool IsStandardTx(const CTransaction& tx, string& reason)
|
||||
|
||||
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
// Time based nLockTime implemented in 0.1.6
|
||||
if (tx.nLockTime == 0)
|
||||
return true;
|
||||
if (nBlockHeight == 0)
|
||||
nBlockHeight = chainActive.Height();
|
||||
if (nBlockTime == 0)
|
||||
nBlockTime = GetAdjustedTime();
|
||||
if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))
|
||||
return true;
|
||||
BOOST_FOREACH(const CTxIn& txin, tx.vin)
|
||||
@@ -687,6 +684,12 @@ bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckFinalTx(const CTransaction &tx)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
return IsFinalTx(tx, chainActive.Height() + 1, GetAdjustedTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check transaction inputs to mitigate two
|
||||
* potential denial-of-service attacks:
|
||||
@@ -903,21 +906,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
||||
// 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.
|
||||
//
|
||||
// However, IsFinalTx() is confusing... Without arguments, it uses
|
||||
// chainActive.Height() to evaluate nLockTime; when a block is accepted,
|
||||
// chainActive.Height() is set to the value of nHeight in the block.
|
||||
// However, when IsFinalTx() is called within CBlock::AcceptBlock(), the
|
||||
// height of the block *being* evaluated is what is used. Thus if we want
|
||||
// to know if a transaction can be part of the *next* block, we need to
|
||||
// call IsFinalTx() with one more than chainActive.Height().
|
||||
//
|
||||
// Timestamps on the other hand don't get any special treatment, because we
|
||||
// can't know what timestamp the next block will have, and there aren't
|
||||
// timestamp applications where it matters.
|
||||
if (!IsFinalTx(tx, chainActive.Height() + 1))
|
||||
return state.DoS(0,
|
||||
error("AcceptToMemoryPool: non-final"),
|
||||
if (!CheckFinalTx(tx))
|
||||
return state.DoS(0, error("AcceptToMemoryPool: non-final"),
|
||||
REJECT_NONSTANDARD, "non-final");
|
||||
|
||||
// is it already in the memory pool?
|
||||
@@ -2839,7 +2829,7 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, CDiskBlockPos* dbp)
|
||||
bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex, bool fRequested, CDiskBlockPos* dbp)
|
||||
{
|
||||
const CChainParams& chainparams = Params();
|
||||
AssertLockHeld(cs_main);
|
||||
@@ -2849,13 +2839,18 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
|
||||
if (!AcceptBlockHeader(block, state, &pindex))
|
||||
return false;
|
||||
|
||||
// If we're pruning, ensure that we don't allow a peer to dump a copy
|
||||
// of old blocks. But we might need blocks that are not on the main chain
|
||||
// to handle a reorg, even if we've processed once.
|
||||
if (pindex->nStatus & BLOCK_HAVE_DATA || chainActive.Contains(pindex)) {
|
||||
// TODO: deal better with duplicate blocks.
|
||||
// return state.DoS(20, error("AcceptBlock(): already have block %d %s", pindex->nHeight, pindex->GetBlockHash().ToString()), REJECT_DUPLICATE, "duplicate");
|
||||
return true;
|
||||
// Try to process all requested blocks that we don't have, but only
|
||||
// process an unrequested block if it's new and has enough work to
|
||||
// advance our tip.
|
||||
bool fAlreadyHave = pindex->nStatus & BLOCK_HAVE_DATA;
|
||||
bool fHasMoreWork = (chainActive.Tip() ? pindex->nChainWork > chainActive.Tip()->nChainWork : true);
|
||||
|
||||
// TODO: deal better with return value and error conditions for duplicate
|
||||
// and unrequested blocks.
|
||||
if (fAlreadyHave) return true;
|
||||
if (!fRequested) { // If we didn't ask for it:
|
||||
if (pindex->nTx != 0) return true; // This is a previously-processed block that was pruned
|
||||
if (!fHasMoreWork) return true; // Don't process less-work chains
|
||||
}
|
||||
|
||||
if ((!CheckBlock(block, state)) || !ContextualCheckBlock(block, state, pindex->pprev)) {
|
||||
@@ -2904,21 +2899,22 @@ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned
|
||||
}
|
||||
|
||||
|
||||
bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp)
|
||||
bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, bool fForceProcessing, CDiskBlockPos *dbp)
|
||||
{
|
||||
// Preliminary checks
|
||||
bool checked = CheckBlock(*pblock, state);
|
||||
|
||||
{
|
||||
LOCK(cs_main);
|
||||
MarkBlockAsReceived(pblock->GetHash());
|
||||
bool fRequested = MarkBlockAsReceived(pblock->GetHash());
|
||||
fRequested |= fForceProcessing;
|
||||
if (!checked) {
|
||||
return error("%s: CheckBlock FAILED", __func__);
|
||||
}
|
||||
|
||||
// Store to disk
|
||||
CBlockIndex *pindex = NULL;
|
||||
bool ret = AcceptBlock(*pblock, state, &pindex, dbp);
|
||||
bool ret = AcceptBlock(*pblock, state, &pindex, fRequested, dbp);
|
||||
if (pindex && pfrom) {
|
||||
mapBlockSource[pindex->GetBlockHash()] = pfrom->GetId();
|
||||
}
|
||||
@@ -3466,7 +3462,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
||||
// process in case the block isn't known yet
|
||||
if (mapBlockIndex.count(hash) == 0 || (mapBlockIndex[hash]->nStatus & BLOCK_HAVE_DATA) == 0) {
|
||||
CValidationState state;
|
||||
if (ProcessNewBlock(state, NULL, &block, dbp))
|
||||
if (ProcessNewBlock(state, NULL, &block, true, dbp))
|
||||
nLoaded++;
|
||||
if (state.IsError())
|
||||
break;
|
||||
@@ -3488,7 +3484,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
||||
LogPrintf("%s: Processing out of order child %s of %s\n", __func__, block.GetHash().ToString(),
|
||||
head.ToString());
|
||||
CValidationState dummy;
|
||||
if (ProcessNewBlock(dummy, NULL, &block, &it->second))
|
||||
if (ProcessNewBlock(dummy, NULL, &block, true, &it->second))
|
||||
{
|
||||
nLoaded++;
|
||||
queue.push_back(block.GetHash());
|
||||
@@ -4268,6 +4264,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
|
||||
LOCK(cs_main);
|
||||
|
||||
if (IsInitialBlockDownload())
|
||||
return true;
|
||||
|
||||
CBlockIndex* pindex = NULL;
|
||||
if (locator.IsNull())
|
||||
{
|
||||
@@ -4472,7 +4471,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
pfrom->AddInventoryKnown(inv);
|
||||
|
||||
CValidationState state;
|
||||
ProcessNewBlock(state, pfrom, &block);
|
||||
// Process all blocks from whitelisted peers, even if not requested.
|
||||
ProcessNewBlock(state, pfrom, &block, pfrom->fWhitelisted, NULL);
|
||||
int nDoS;
|
||||
if (state.IsInvalid(nDoS)) {
|
||||
pfrom->PushMessage("reject", strCommand, state.GetRejectCode(),
|
||||
|
||||
20
src/main.h
20
src/main.h
@@ -153,10 +153,11 @@ void UnregisterNodeSignals(CNodeSignals& nodeSignals);
|
||||
* @param[out] state This may be set to an Error state if any error occurred processing it, including during validation/connection/etc of otherwise unrelated blocks during reorganisation; or it may be set to an Invalid state if pblock is itself invalid (but this is not guaranteed even when the block is checked). If you want to *possibly* get feedback on whether pblock is valid, you must also install a CValidationInterface (see validationinterface.h) - this will have its BlockChecked method called whenever *any* block completes validation.
|
||||
* @param[in] pfrom The node which we are receiving the block from; it is added to mapBlockSource and may be penalised if the block is invalid.
|
||||
* @param[in] pblock The block we want to process.
|
||||
* @param[in] fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.
|
||||
* @param[out] dbp If pblock is stored to disk (or already there), this will be set to its location.
|
||||
* @return True if state.IsValid()
|
||||
*/
|
||||
bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL);
|
||||
bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, bool fForceProcessing, CDiskBlockPos *dbp);
|
||||
/** Check whether enough disk space is available for an incoming block */
|
||||
bool CheckDiskSpace(uint64_t nAdditionalBytes = 0);
|
||||
/** Open a block file (blk?????.dat) */
|
||||
@@ -324,7 +325,18 @@ bool CheckTransaction(const CTransaction& tx, CValidationState& state);
|
||||
*/
|
||||
bool IsStandardTx(const CTransaction& tx, std::string& reason);
|
||||
|
||||
bool IsFinalTx(const CTransaction &tx, int nBlockHeight = 0, int64_t nBlockTime = 0);
|
||||
/**
|
||||
* Check if transaction is final and can be included in a block with the
|
||||
* specified height and time. Consensus critical.
|
||||
*/
|
||||
bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);
|
||||
|
||||
/**
|
||||
* Check if transaction will be final in the next block to be created.
|
||||
*
|
||||
* Calls IsFinalTx() with current block height and appropriate block time.
|
||||
*/
|
||||
bool CheckFinalTx(const CTransaction &tx);
|
||||
|
||||
/**
|
||||
* Closure representing one script verification
|
||||
@@ -389,8 +401,8 @@ 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 CBlock& block, CBlockIndex *pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
|
||||
|
||||
/** Store block on disk. If dbp is provided, the file is known to already reside on disk */
|
||||
bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, CDiskBlockPos* dbp = NULL);
|
||||
/** Store block on disk. If dbp is non-NULL, the file is known to already reside on disk */
|
||||
bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex **pindex, bool fRequested, CDiskBlockPos* dbp);
|
||||
bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex **ppindex= NULL);
|
||||
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
LOCK2(cs_main, mempool.cs);
|
||||
CBlockIndex* pindexPrev = chainActive.Tip();
|
||||
const int nHeight = pindexPrev->nHeight + 1;
|
||||
pblock->nTime = GetAdjustedTime();
|
||||
CCoinsViewCache view(pcoinsTip);
|
||||
|
||||
// Priority order to process transactions
|
||||
@@ -152,7 +153,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
||||
mi != mempool.mapTx.end(); ++mi)
|
||||
{
|
||||
const CTransaction& tx = mi->second.GetTx();
|
||||
if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight))
|
||||
if (tx.IsCoinBase() || !IsFinalTx(tx, nHeight, pblock->nTime))
|
||||
continue;
|
||||
|
||||
COrphan* porphan = NULL;
|
||||
@@ -433,7 +434,7 @@ static bool ProcessBlockFound(CBlock* pblock, CWallet& wallet, CReserveKey& rese
|
||||
|
||||
// Process this block the same as if we had received it from another node
|
||||
CValidationState state;
|
||||
if (!ProcessNewBlock(state, NULL, pblock))
|
||||
if (!ProcessNewBlock(state, NULL, pblock, true, NULL))
|
||||
return error("BitcoinMiner: ProcessNewBlock, block not accepted");
|
||||
|
||||
return true;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<name>AddressBookPage</name>
|
||||
<message>
|
||||
<source>Right-click to edit address or label</source>
|
||||
<translation>Haz-clic para editar la dirección o etiqueta</translation>
|
||||
<translation>Haz clic derecho para editar la dirección o etiqueta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Create a new address</source>
|
||||
@@ -394,6 +394,10 @@
|
||||
<source>&About Bitcoin Core</source>
|
||||
<translation>&Acerca de Bitcoin Core</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Modify configuration options for Bitcoin Core</source>
|
||||
<translation>Modificar las opciones de configuración de Bitcoin</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show the list of used sending addresses and labels</source>
|
||||
<translation>Mostrar la lista de direcciones de envío y etiquetas</translation>
|
||||
@@ -698,6 +702,10 @@
|
||||
<source>This label turns red if the priority is smaller than "medium".</source>
|
||||
<translation>Esta etiqueta se mostrará en rojo si la prioridad es menor a "media"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This label turns red if any recipient receives an amount smaller than %1.</source>
|
||||
<translation>Esta etiqueta se vuelve roja si el cambio es menor que %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Can vary +/- %1 satoshi(s) per input.</source>
|
||||
<translation>Puede variar en +/- %1 satoshi(s) por entrada.</translation>
|
||||
@@ -948,6 +956,10 @@
|
||||
<source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>
|
||||
<translation>Dirección IP del proxy (p. ej. IPv4: 127.0.0.1 / IPv6: ::1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The user interface language can be set here. This setting will take effect after restarting Bitcoin Core.</source>
|
||||
<translation>El idioma de la interfaz de usuario puede establecerse aquí. Este ajuste se aplicará cuando se reinicie Bitcoin.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>
|
||||
<translation>Identificadores URL de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como elementos del menú contextual. El %s en la URL es reemplazado por el valor hash de la transacción. Se pueden separar URL múltiples por una barra vertical |.</translation>
|
||||
@@ -1092,6 +1104,10 @@
|
||||
<source>Client restart required to activate changes.</source>
|
||||
<translation>Se necesita reiniciar el cliente para activar los cambios.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Client will be shut down. Do you want to proceed?</source>
|
||||
<translation>El cliente se cerrará. ¿Desea continuar?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This change would require a client restart.</source>
|
||||
<translation>Este cambio exige el reinicio del cliente.</translation>
|
||||
@@ -1966,6 +1982,10 @@
|
||||
<source>Pay only the minimum fee of %1</source>
|
||||
<translation>Paga sólo la cuota mínima de %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Duplicate address found: addresses should only be used once each.</source>
|
||||
<translation>Se ha encontrado una dirección duplicada. Solo se puede enviar a cada dirección una vez por operación de envío.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Warning: Invalid Bitcoin address</source>
|
||||
<translation>Alerta: Dirección de Bitcoin inválida</translation>
|
||||
@@ -2992,6 +3012,10 @@
|
||||
<source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source>
|
||||
<translation>Consulta de direcciones pares mediante búsqueda de DNS, si bajo en direcciones (por defecto: 1 a menos que - conectar)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Require high priority for relaying free or low-fee transactions (default: %u)</source>
|
||||
<translation>Se requiere alta prioridad para retransmitir transacciones gratis o de baja comisión (por defecto:%u)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: %d)</source>
|
||||
<translation>Establecer tamaño máximo de las transacciones de alta prioridad/baja comisión en bytes (predeterminado: %d)</translation>
|
||||
@@ -3000,6 +3024,10 @@
|
||||
<source>Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)</source>
|
||||
<translation>Ajuste el número de hilos para la generación de moneda si está habilitado (-1 = all cores, default: %d)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The transaction amount is too small to send after the fee has been deducted</source>
|
||||
<translation>Monto de transacción muy pequeña luego de la deducción por comisión</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>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.</source>
|
||||
<translation>Este producto incluye software desarrollado por el OpenSSL Project para su uso en OpenSSL Toolkit <https://www.openssl.org/>, software de cifrado escrito por Eric Young y software UPnP escrito por Thomas Bernard.</translation>
|
||||
@@ -3176,6 +3204,10 @@ por ejemplo: alertnotify=echo %% s | correo -s "Alerta Bitcoin" admin@foo.com
|
||||
<source>Start minimized</source>
|
||||
<translation>Arrancar minimizado</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The transaction amount is too small to pay the fee</source>
|
||||
<translation>Cantidad de la transacción demasiado pequeña para pagar la comisión</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This is experimental software.</source>
|
||||
<translation>Este software es experimental.</translation>
|
||||
@@ -3196,6 +3228,10 @@ por ejemplo: alertnotify=echo %% s | correo -s "Alerta Bitcoin" admin@foo.com
|
||||
<source>Transaction too large</source>
|
||||
<translation>Transacción demasiado grande</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>UI Options:</source>
|
||||
<translation>Opciones de interfaz de usuario</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to bind to %s on this computer (bind returned error %s)</source>
|
||||
<translation>No es posible conectar con %s en este sistema (bind ha dado el error %s)</translation>
|
||||
|
||||
@@ -65,6 +65,10 @@
|
||||
<source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
|
||||
<translation>اینها نشانیهای بیتکوین شما برای ارسال وجود هستند. همیشه قبل از ارسال سکهها، نشانی دریافتکننده و مقدار ارسالی را بررسی کنید.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
|
||||
<translation>اینها نشانیهای بیتکوین شما برای دریافت وجوه هستند. توصیه میشود یک نشانی دریافت جدید برای هر تبادل استفاده کنید.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy &Label</source>
|
||||
<translation>کپی و برچسب&گذاری</translation>
|
||||
@@ -155,6 +159,10 @@
|
||||
<source>Are you sure you wish to encrypt your wallet?</source>
|
||||
<translation>آیا مطمئن هستید که میخواهید کیف پول خود را رمزنگاری کنید؟</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Bitcoin Core will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>
|
||||
<translation>هسته بیتکوین هم اکنون بسته میشود تا فرایند رمزگذاری را تمام کند. به خاطر داشته باشید که رمزگذاری کردن کیف پولتان نمیتواند به طور کامل بیتکوینهای شما را در برابر دزدیده شدن توسط بدافزارهایی که رایانهی شما را آلوده میکنند، محافظت نماید.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
|
||||
<translation>مهم: هر نسخهٔ پشتیبانی که تا کنون از کیف پول خود تهیه کردهاید، باید با کیف پول رمزنگاری شدهٔ جدید جایگزین شود. به دلایل امنیتی، پروندهٔ قدیمی کیف پول بدون رمزنگاری، تا زمانی که از کیف پول رمزنگاریشدهٔ جدید استفاده نکنید، غیرقابل استفاده خواهد بود.</translation>
|
||||
@@ -456,10 +464,26 @@
|
||||
<source>Change:</source>
|
||||
<translation>پول خورد:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Tree mode</source>
|
||||
<translation>مدل درختی</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>List mode</source>
|
||||
<translation>مدل لیست</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Amount</source>
|
||||
<translation>مبلغ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Received with label</source>
|
||||
<translation>دریافت شده با برچسب</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Received with address</source>
|
||||
<translation>دریافت شده با نشانی</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Date</source>
|
||||
<translation>تاریخ</translation>
|
||||
@@ -468,6 +492,10 @@
|
||||
<source>Confirmed</source>
|
||||
<translation>تأیید شده</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Priority</source>
|
||||
<translation>اولویت</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copy address</source>
|
||||
<translation>کپی نشانی</translation>
|
||||
@@ -484,6 +512,22 @@
|
||||
<source>Copy transaction ID</source>
|
||||
<translation>کپی شناسهٔ تراکنش</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>low</source>
|
||||
<translation>کم</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>lower</source>
|
||||
<translation>کمتر</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>lowest</source>
|
||||
<translation>کمترین</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation>هیچکدام</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>yes</source>
|
||||
<translation>بله</translation>
|
||||
@@ -706,6 +750,10 @@
|
||||
<source>default</source>
|
||||
<translation>پیشفرض</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>none</source>
|
||||
<translation>هیچکدام</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Confirm options reset</source>
|
||||
<translation>تأییدِ بازنشانی گزینهها</translation>
|
||||
@@ -764,10 +812,22 @@
|
||||
<source>URI handling</source>
|
||||
<translation>مدیریت URI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Payment request error</source>
|
||||
<translation>خطای درخواست پرداخت</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Cannot start bitcoin: click-to-pay handler</source>
|
||||
<translation>نمیتوان بیتکوین را اجرا کرد: کنترلکنندهٔ کلیک-و-پرداخت</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Payment request expired.</source>
|
||||
<translation>درخواست پرداخت منقضی شد.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Invalid payment request.</source>
|
||||
<translation>درخواست پرداخت نامعتبر</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PeerTableModel</name>
|
||||
@@ -1028,6 +1088,10 @@
|
||||
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
|
||||
<translation>با احتساب هزینهٔ %1 برای هر تراکنش، مجموع میزان پرداختی از مبلغ تراز شما بیشتر میشود.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Payment request expired.</source>
|
||||
<translation>درخواست پرداخت منقضی شد.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>(no label)</source>
|
||||
<translation>(بدون برچسب)</translation>
|
||||
@@ -1051,6 +1115,18 @@
|
||||
<source>&Label:</source>
|
||||
<translation>&برچسب:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Choose previously used address</source>
|
||||
<translation>انتخاب نشانی پیشتر استفاده شده</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>This is a normal payment.</source>
|
||||
<translation>این یک پرداخت عادی است</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The Bitcoin address to send the payment to</source>
|
||||
<translation>نشانی بیتکوین برای ارسال پرداخت به آن</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alt+A</source>
|
||||
<translation>Alt+A</translation>
|
||||
@@ -1063,6 +1139,10 @@
|
||||
<source>Alt+P</source>
|
||||
<translation>Alt+P</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove this entry</source>
|
||||
<translation>حذف این مدخل</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Message:</source>
|
||||
<translation>پیام:</translation>
|
||||
@@ -1081,6 +1161,14 @@
|
||||
<source>&Sign Message</source>
|
||||
<translation>ا&مضای پیام</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The Bitcoin address to sign the message with</source>
|
||||
<translation>نشانی بیتکوین برای امضاء پیغام با آن</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Choose previously used address</source>
|
||||
<translation>انتخاب نشانی پیشتر استفاده شده</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Alt+A</source>
|
||||
<translation>Alt+A</translation>
|
||||
@@ -1125,6 +1213,10 @@
|
||||
<source>&Verify Message</source>
|
||||
<translation>&شناسایی پیام</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The Bitcoin address the message was signed with</source>
|
||||
<translation>نشانی بیتکوین که پیغام با آن امضاء شده</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Verify the message to ensure it was signed with the specified Bitcoin address</source>
|
||||
<translation>برای حصول اطمینان از اینکه پیام با نشانی بیتکوین مشخص شده امضا است یا خیر، پیام را شناسایی کنید</translation>
|
||||
@@ -1196,6 +1288,10 @@
|
||||
<source>Bitcoin Core</source>
|
||||
<translation> هسته Bitcoin </translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The Bitcoin Core developers</source>
|
||||
<translation>توسعهدهندگان هسته بیتکوین</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[testnet]</source>
|
||||
<translation>آزمایش شبکه</translation>
|
||||
@@ -1203,7 +1299,11 @@
|
||||
</context>
|
||||
<context>
|
||||
<name>TrafficGraphWidget</name>
|
||||
</context>
|
||||
<message>
|
||||
<source>KB/s</source>
|
||||
<translation>کیلوبایت</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TransactionDesc</name>
|
||||
<message>
|
||||
@@ -1503,6 +1603,10 @@
|
||||
<source>Exporting Failed</source>
|
||||
<translation>استخراج انجام نشد</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Exporting Successful</source>
|
||||
<translation>استخراج موفق</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Comma separated file (*.csv)</source>
|
||||
<translation>پروندهٔ نوع CSV جداشونده با کاما (*.csv)</translation>
|
||||
@@ -1658,10 +1762,22 @@
|
||||
<source>Error opening block database</source>
|
||||
<translation>خطا در بازگشایی پایگاه داده ی بلوک</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error: A fatal internal error occured, see debug.log for details</source>
|
||||
<translation>خطا: یک خطای داخلی مهلک روی داد، debug.log را برای جزئیات ببینید</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error: Disk space is low!</source>
|
||||
<translation>خطا: فضای دیسک کم است!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
|
||||
<translation>شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0 برای اینکار استفاده کیند.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Importing...</source>
|
||||
<translation>در حال پیادهسازی...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Verifying blocks...</source>
|
||||
<translation>در حال بازبینی بلوک ها...</translation>
|
||||
@@ -1670,6 +1786,10 @@
|
||||
<source>Verifying wallet...</source>
|
||||
<translation>در حال بازبینی کیف پول...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Bitcoin Core will not work properly.</source>
|
||||
<translation>هشدار: تاریخ و ساعت کامپیوتر خود را بررسی کنید. اگر ساعت درست نباشد هسته بیتکوین به درستی کار نخواهد کرد.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Choose data directory on startup (default: 0)</source>
|
||||
<translation>انتخاب مسیر دادهها در ابتدای اجرای برنامه (پیشفرض: 0)</translation>
|
||||
@@ -1698,6 +1818,10 @@
|
||||
<source>Start minimized</source>
|
||||
<translation>اجرای برنامه به صورت کوچکشده</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>UI Options:</source>
|
||||
<translation>گزینههای رابط کاربری:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
|
||||
<translation>از UPnP برای شناسایی درگاه شنیداری استفاده کنید (پیش فرض:1 در زمان شنیدن)</translation>
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
<TS language="pam" version="2.1">
|
||||
<context>
|
||||
<name>AddressBookPage</name>
|
||||
<message>
|
||||
<source>Right-click to edit address or label</source>
|
||||
<translation>I-right click ban alilan ing address o libel</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Create a new address</source>
|
||||
<translation>Maglalang kang bayung address</translation>
|
||||
|
||||
@@ -2110,7 +2110,7 @@
|
||||
</message>
|
||||
<message>
|
||||
<source>Do not shut down the computer until this window disappears.</source>
|
||||
<translation>Não desligue o computador até esta janela desapareça.</translation>
|
||||
<translation>Não desligue o computador até que esta janela desapareça.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
||||
@@ -26,7 +26,7 @@ using namespace std;
|
||||
QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
if (!IsFinalTx(wtx, chainActive.Height() + 1))
|
||||
if (!CheckFinalTx(wtx))
|
||||
{
|
||||
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
|
||||
return tr("Open for %n more block(s)", "", wtx.nLockTime - chainActive.Height());
|
||||
|
||||
@@ -188,7 +188,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
|
||||
status.depth = wtx.GetDepthInMainChain();
|
||||
status.cur_num_blocks = chainActive.Height();
|
||||
|
||||
if (!IsFinalTx(wtx, chainActive.Height() + 1))
|
||||
if (!CheckFinalTx(wtx))
|
||||
{
|
||||
if (wtx.nLockTime < LOCKTIME_THRESHOLD)
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ Value generate(const Array& params, bool fHelp)
|
||||
++pblock->nNonce;
|
||||
}
|
||||
CValidationState state;
|
||||
if (!ProcessNewBlock(state, NULL, pblock))
|
||||
if (!ProcessNewBlock(state, NULL, pblock, true, NULL))
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
|
||||
++nHeight;
|
||||
blockHashes.push_back(pblock->GetHash().GetHex());
|
||||
@@ -650,7 +650,7 @@ Value submitblock(const Array& params, bool fHelp)
|
||||
CValidationState state;
|
||||
submitblock_StateCatcher sc(block.GetHash());
|
||||
RegisterValidationInterface(&sc);
|
||||
bool fAccepted = ProcessNewBlock(state, NULL, &block);
|
||||
bool fAccepted = ProcessNewBlock(state, NULL, &block, true, NULL);
|
||||
UnregisterValidationInterface(&sc);
|
||||
if (fBlockPresent)
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
|
||||
pblock->nNonce = blockinfo[i].nonce;
|
||||
CValidationState state;
|
||||
BOOST_CHECK(ProcessNewBlock(state, NULL, pblock));
|
||||
BOOST_CHECK(ProcessNewBlock(state, NULL, pblock, true, NULL));
|
||||
BOOST_CHECK(state.IsValid());
|
||||
pblock->hashPrevBlock = pblock->GetHash();
|
||||
}
|
||||
@@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
tx.nLockTime = chainActive.Tip()->nHeight+1;
|
||||
hash = tx.GetHash();
|
||||
mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11));
|
||||
BOOST_CHECK(!IsFinalTx(tx, chainActive.Tip()->nHeight + 1));
|
||||
BOOST_CHECK(!CheckFinalTx(tx));
|
||||
|
||||
// time locked
|
||||
tx2.vin.resize(1);
|
||||
@@ -237,7 +237,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
tx2.nLockTime = chainActive.Tip()->GetMedianTimePast()+1;
|
||||
hash = tx2.GetHash();
|
||||
mempool.addUnchecked(hash, CTxMemPoolEntry(tx2, 11, GetTime(), 111.0, 11));
|
||||
BOOST_CHECK(!IsFinalTx(tx2));
|
||||
BOOST_CHECK(!CheckFinalTx(tx2));
|
||||
|
||||
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
|
||||
|
||||
@@ -249,8 +249,10 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||
chainActive.Tip()->nHeight++;
|
||||
SetMockTime(chainActive.Tip()->GetMedianTimePast()+2);
|
||||
|
||||
BOOST_CHECK(IsFinalTx(tx, chainActive.Tip()->nHeight + 1));
|
||||
BOOST_CHECK(IsFinalTx(tx2));
|
||||
// FIXME: we should *actually* create a new block so the following test
|
||||
// works; CheckFinalTx() isn't fooled by monkey-patching nHeight.
|
||||
//BOOST_CHECK(CheckFinalTx(tx));
|
||||
//BOOST_CHECK(CheckFinalTx(tx2));
|
||||
|
||||
BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey));
|
||||
BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3);
|
||||
|
||||
@@ -140,6 +140,24 @@ BOOST_AUTO_TEST_CASE(rpc_parse_monetary_values)
|
||||
BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString("20999999.99999999")), 2099999999999999LL);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(json_parse_errors)
|
||||
{
|
||||
Value value;
|
||||
// Valid
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("1.0"), value), true);
|
||||
// Valid, with trailing whitespace
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("1.0 "), value), true);
|
||||
// Invalid, initial garbage
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("[1.0"), value), false);
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("a1.0"), value), false);
|
||||
// Invalid, trailing garbage
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("1.0sds"), value), false);
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("1.0]"), value), false);
|
||||
// BTC addresses should fail parsing
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"), value), false);
|
||||
BOOST_CHECK_EQUAL(read_string(std::string("3J98t1WpEZ73CNmQviecrnyiWrnqRhWNL"), value), false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(rpc_boostasiotocnetaddr)
|
||||
{
|
||||
// Check IPv4 addresses
|
||||
|
||||
@@ -588,7 +588,7 @@ Value getreceivedbyaddress(const Array& params, bool fHelp)
|
||||
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx& wtx = (*it).second;
|
||||
if (wtx.IsCoinBase() || !IsFinalTx(wtx))
|
||||
if (wtx.IsCoinBase() || !CheckFinalTx(wtx))
|
||||
continue;
|
||||
|
||||
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
|
||||
@@ -642,7 +642,7 @@ Value getreceivedbyaccount(const Array& params, bool fHelp)
|
||||
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx& wtx = (*it).second;
|
||||
if (wtx.IsCoinBase() || !IsFinalTx(wtx))
|
||||
if (wtx.IsCoinBase() || !CheckFinalTx(wtx))
|
||||
continue;
|
||||
|
||||
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
|
||||
@@ -666,7 +666,7 @@ CAmount GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi
|
||||
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx& wtx = (*it).second;
|
||||
if (!IsFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 0)
|
||||
if (!CheckFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 0)
|
||||
continue;
|
||||
|
||||
CAmount nReceived, nSent, nFee;
|
||||
@@ -1109,7 +1109,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
|
||||
{
|
||||
const CWalletTx& wtx = (*it).second;
|
||||
|
||||
if (wtx.IsCoinBase() || !IsFinalTx(wtx))
|
||||
if (wtx.IsCoinBase() || !CheckFinalTx(wtx))
|
||||
continue;
|
||||
|
||||
int nDepth = wtx.GetDepthInMainChain();
|
||||
|
||||
@@ -1318,7 +1318,7 @@ CAmount CWalletTx::GetChange() const
|
||||
bool CWalletTx::IsTrusted() const
|
||||
{
|
||||
// Quick answer in most cases
|
||||
if (!IsFinalTx(*this))
|
||||
if (!CheckFinalTx(*this))
|
||||
return false;
|
||||
int nDepth = GetDepthInMainChain();
|
||||
if (nDepth >= 1)
|
||||
@@ -1424,7 +1424,7 @@ CAmount CWallet::GetUnconfirmedBalance() const
|
||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
if (!IsFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0))
|
||||
if (!CheckFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0))
|
||||
nTotal += pcoin->GetAvailableCredit();
|
||||
}
|
||||
}
|
||||
@@ -1469,7 +1469,7 @@ CAmount CWallet::GetUnconfirmedWatchOnlyBalance() const
|
||||
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
|
||||
{
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
if (!IsFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0))
|
||||
if (!CheckFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0))
|
||||
nTotal += pcoin->GetAvailableWatchOnlyCredit();
|
||||
}
|
||||
}
|
||||
@@ -1504,7 +1504,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
|
||||
const uint256& wtxid = it->first;
|
||||
const CWalletTx* pcoin = &(*it).second;
|
||||
|
||||
if (!IsFinalTx(*pcoin))
|
||||
if (!CheckFinalTx(*pcoin))
|
||||
continue;
|
||||
|
||||
if (fOnlyConfirmed && !pcoin->IsTrusted())
|
||||
@@ -2291,7 +2291,7 @@ std::map<CTxDestination, CAmount> CWallet::GetAddressBalances()
|
||||
{
|
||||
CWalletTx *pcoin = &walletEntry.second;
|
||||
|
||||
if (!IsFinalTx(*pcoin) || !pcoin->IsTrusted())
|
||||
if (!CheckFinalTx(*pcoin) || !pcoin->IsTrusted())
|
||||
continue;
|
||||
|
||||
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
|
||||
|
||||
Reference in New Issue
Block a user