diff options
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | depends/funcs.mk | 4 | ||||
-rw-r--r-- | qa/rpc-tests/util.py | 10 | ||||
-rw-r--r-- | src/addrman.cpp | 6 | ||||
-rw-r--r-- | src/qt/test/paymentrequestdata.h | 4 | ||||
-rw-r--r-- | src/qt/test/paymentservertests.cpp | 9 | ||||
-rw-r--r-- | src/qt/test/paymentservertests.h | 8 | ||||
-rw-r--r-- | src/qt/test/test_main.cpp | 7 | ||||
-rw-r--r-- | src/qt/test/uritests.cpp | 4 | ||||
-rw-r--r-- | src/qt/test/uritests.h | 4 |
10 files changed, 48 insertions, 16 deletions
diff --git a/.travis.yml b/.travis.yml index 2073e71769..379a0e1df7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,12 @@ env: - CCACHE_TEMPDIR=/tmp/.ccache-temp - CCACHE_COMPRESS=1 - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out + - SDK_URL=https://bitcoincore.org/depends-sources/sdks cache: apt: true directories: - depends/built + - depends/sdk-sources - $HOME/.ccache matrix: fast_finish: true @@ -30,6 +32,8 @@ matrix: env: HOST=x86_64-unknown-linux-gnu RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" - compiler: "true 4" env: HOST=i686-pc-linux-gnu PACKAGES="g++-multilib" RUN_TESTS=true GOAL="install" BITCOIN_CONFIG="--enable-glibc-back-compat" + - compiler: "true 5" + env: HOST=x86_64-apple-darwin11 PACKAGES="gcc-multilib g++-multilib cmake libcap-dev libz-dev libbz2-dev" OSX_SDK=10.7 GOAL="deploy" - compiler: "true 6" env: HOST=x86_64-w64-mingw32 PACKAGES="nsis gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-dev" GOAL="deploy" - compiler: "true 7" @@ -39,7 +43,9 @@ install: - if [ -n "$PACKAGES" ]; then travis_retry sudo apt-get install --no-upgrade -qq $PACKAGES; fi before_script: - unset CC; unset CXX - - mkdir -p depends/SDKs + - mkdir -p depends/SDKs depends/sdk-sources + - if [ -n "$OSX_SDK" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then wget $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -O depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi + - if [ -n "$OSX_SDK" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi - make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS || (echo "Build failure. Verbose build follows." && make -C depends V=1 HOST=$HOST $DEP_OPTS) script: - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST diff --git a/depends/funcs.mk b/depends/funcs.mk index 280706efb3..28bfb85492 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -22,8 +22,8 @@ endef define fetch_file (test -f $(SOURCES_PATH)/$(4) || \ ( mkdir -p $$($(1)_extract_dir) && \ - ( $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)/$(3)" || \ - $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(FALLBACK_DOWNLOAD_PATH)/$(3)" ) && \ + ( $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(4).temp" "$(2)/$(3)" || \ + $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(4).temp" "$(FALLBACK_DOWNLOAD_PATH)/$(3)" ) && \ echo "$(5) $$($(1)_extract_dir)/$(4).temp" > $$($(1)_extract_dir)/.$(4).hash && \ $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$(4).hash && \ mv $$($(1)_extract_dir)/$(4).temp $(SOURCES_PATH)/$(4) )) diff --git a/qa/rpc-tests/util.py b/qa/rpc-tests/util.py index da2b6df197..87baadc5d6 100644 --- a/qa/rpc-tests/util.py +++ b/qa/rpc-tests/util.py @@ -10,7 +10,7 @@ import os import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "python-bitcoinrpc")) -from decimal import Decimal +from decimal import Decimal, ROUND_DOWN import json import random import shutil @@ -230,10 +230,12 @@ def make_change(from_node, amount_in, amount_out, fee): change = amount_in - amount if change > amount*2: # Create an extra change output to break up big inputs - outputs[from_node.getnewaddress()] = float(change/2) - change = change/2 + change_address = from_node.getnewaddress() + # Split change in two, being careful of rounding: + outputs[change_address] = Decimal(change/2).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN) + change = amount_in - amount - outputs[change_address] if change > 0: - outputs[from_node.getnewaddress()] = float(change) + outputs[from_node.getnewaddress()] = change return outputs def send_zeropri_transaction(from_node, to_node, amount, fee): diff --git a/src/addrman.cpp b/src/addrman.cpp index 704766dbf8..68948ac7ff 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -45,13 +45,13 @@ bool CAddrInfo::IsTerrible(int64_t nNow) const if (nTime > nNow + 10*60) // came in a flying DeLorean return true; - if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*86400) // not seen in over a month + if (nTime==0 || nNow-nTime > ADDRMAN_HORIZON_DAYS*24*60*60) // not seen in recent history return true; - if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried three times and never a success + if (nLastSuccess==0 && nAttempts>=ADDRMAN_RETRIES) // tried N times and never a success return true; - if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*86400 && nAttempts>=ADDRMAN_MAX_FAILURES) // 10 successive failures in the last week + if (nNow-nLastSuccess > ADDRMAN_MIN_FAIL_DAYS*24*60*60 && nAttempts>=ADDRMAN_MAX_FAILURES) // N successive failures in the last week return true; return false; diff --git a/src/qt/test/paymentrequestdata.h b/src/qt/test/paymentrequestdata.h index 49558165f0..aeaa7d89a0 100644 --- a/src/qt/test/paymentrequestdata.h +++ b/src/qt/test/paymentrequestdata.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + // // Data for paymentservertests.cpp // diff --git a/src/qt/test/paymentservertests.cpp b/src/qt/test/paymentservertests.cpp index e92a7d2b1a..5d7fe96285 100644 --- a/src/qt/test/paymentservertests.cpp +++ b/src/qt/test/paymentservertests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "paymentservertests.h" #include "optionsmodel.h" @@ -21,7 +25,6 @@ X509 *parse_b64der_cert(const char* cert_data) return cert; } - // // Test payment request handling // @@ -30,7 +33,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsig { RecipientCatcher sigCatcher; QObject::connect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), - &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); + &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); // Write data to a temp file: QTemporaryFile f; @@ -48,7 +51,7 @@ static SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsig QCoreApplication::sendEvent(&object, &event); QObject::disconnect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)), - &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); + &sigCatcher, SLOT(getRecipient(SendCoinsRecipient))); // Return results from sigCatcher return sigCatcher.recipient; diff --git a/src/qt/test/paymentservertests.h b/src/qt/test/paymentservertests.h index 884e535a60..9b6400b0d5 100644 --- a/src/qt/test/paymentservertests.h +++ b/src/qt/test/paymentservertests.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef PAYMENTSERVERTESTS_H #define PAYMENTSERVERTESTS_H @@ -15,8 +19,8 @@ private slots: }; // Dummy class to receive paymentserver signals. -// If SendCoinsRecipient was a proper QObject, then we could use -// QSignalSpy... but it's not. +// If SendCoinsRecipient was a proper QObject, then +// we could use QSignalSpy... but it's not. class RecipientCatcher : public QObject { Q_OBJECT diff --git a/src/qt/test/test_main.cpp b/src/qt/test/test_main.cpp index 03a2381c06..f2161c2f79 100644 --- a/src/qt/test/test_main.cpp +++ b/src/qt/test/test_main.cpp @@ -1,11 +1,16 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #if defined(HAVE_CONFIG_H) #include "config/bitcoin-config.h" #endif +#include "uritests.h" + #ifdef ENABLE_WALLET #include "paymentservertests.h" #endif -#include "uritests.h" #include <QCoreApplication> #include <QObject> diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp index 5c0f4406a7..78a7b1b9b4 100644 --- a/src/qt/test/uritests.cpp +++ b/src/qt/test/uritests.cpp @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "uritests.h" #include "guiutil.h" diff --git a/src/qt/test/uritests.h b/src/qt/test/uritests.h index 17d4280a90..1ea6d9f075 100644 --- a/src/qt/test/uritests.h +++ b/src/qt/test/uritests.h @@ -1,3 +1,7 @@ +// Copyright (c) 2009-2014 The Bitcoin developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #ifndef URITESTS_H #define URITESTS_H |