From: 0xDEADFACE Date: Tue, 9 Feb 2016 10:46:44 +0000 (+0000) Subject: Merge pull request #271 from svost/patch X-Git-Tag: nvc-v0.5.6~95 X-Git-Url: https://git.novaco.in/?a=commitdiff_plain;h=c61087f0b9f30bb77ebce92d40cb32d13186c49b;hp=76dd5491e364e8e7e4694a1a343101412450b419;p=novacoin.git Merge pull request #271 from svost/patch Patch --- diff --git a/COPYING b/COPYING index c22b37d..ad4f1c3 100644 --- a/COPYING +++ b/COPYING @@ -1,8 +1,8 @@ -Copyright © 2009-2015 The Bitcoin developers +Copyright © 2009-2016 The Bitcoin developers Copyright © 2011-2012 The PPCoin Developers Copyright © 2014 The Peerunity Developers Copyright © 2014 The EmerCoin Developers -Copyright © 2012-2015 The NovaCoin developers +Copyright © 2012-2016 The NovaCoin developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/protocol.cpp b/src/protocol.cpp index 5a7dd4a..4dcb7ae 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -18,21 +18,17 @@ static const char* ppszTypeName[] = "block", }; -CMessageHeader::CMessageHeader() +CMessageHeader::CMessageHeader() : nMessageSize(std::numeric_limits::max()), nChecksum(0) { memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart)); memset(pchCommand, 0, sizeof(pchCommand)); pchCommand[1] = 1; - nMessageSize = std::numeric_limits::max(); - nChecksum = 0; } -CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn) +CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn) : nMessageSize(nMessageSizeIn), nChecksum(0) { memcpy(pchMessageStart, ::pchMessageStart, sizeof(pchMessageStart)); strncpy(pchCommand, pszCommand, COMMAND_SIZE); - nMessageSize = nMessageSizeIn; - nChecksum = 0; } std::string CMessageHeader::GetCommand() const @@ -73,39 +69,11 @@ bool CMessageHeader::IsValid() const return true; } - - -CAddress::CAddress() : CService() -{ - Init(); -} - -CAddress::CAddress(CService ipIn, uint64_t nServicesIn) : CService(ipIn) -{ - Init(); - nServices = nServicesIn; -} - -void CAddress::Init() -{ - nServices = NODE_NETWORK; - nTime = 100000000; - nLastTry = 0; -} - -CInv::CInv() -{ - type = 0; - hash = 0; -} - -CInv::CInv(int typeIn, const uint256& hashIn) -{ - type = typeIn; - hash = hashIn; -} - -CInv::CInv(const std::string& strType, const uint256& hashIn) +CAddress::CAddress() : CService(), nServices(NODE_NETWORK), nTime(100000000), nLastTry(0) { } +CAddress::CAddress(CService ipIn, uint64_t nServicesIn) : CService(ipIn), nServices(nServicesIn), nTime(100000000), nLastTry(0) { } +CInv::CInv() : type(0), hash(0) { } +CInv::CInv(int typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) { } +CInv::CInv(const std::string& strType, const uint256& hashIn) : hash(hashIn) { unsigned int i; for (i = 1; i < ARRAYLEN(ppszTypeName); i++) @@ -118,7 +86,6 @@ CInv::CInv(const std::string& strType, const uint256& hashIn) } if (i == ARRAYLEN(ppszTypeName)) throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType.c_str())); - hash = hashIn; } bool operator<(const CInv& a, const CInv& b) diff --git a/src/protocol.h b/src/protocol.h index 519cdc2..b4ebac6 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -19,7 +19,7 @@ extern bool fTestNet; static inline unsigned short GetDefaultPort(const bool testnet = fTestNet) { - return testnet ? 17777 : 7777; + return static_cast(testnet ? 17777 : 7777); } @@ -78,8 +78,6 @@ class CAddress : public CService CAddress(); explicit CAddress(CService ipIn, uint64_t nServicesIn=NODE_NETWORK); - void Init(); - IMPLEMENT_SERIALIZE ( CAddress* pthis = const_cast(this); diff --git a/src/qt/forms/aboutdialog.ui b/src/qt/forms/aboutdialog.ui index 2f776d6..5198785 100644 --- a/src/qt/forms/aboutdialog.ui +++ b/src/qt/forms/aboutdialog.ui @@ -94,11 +94,11 @@ IBeamCursor - Copyright © 2009-2015 The Bitcoin developers + Copyright © 2009-2016 The Bitcoin developers Copyright © 2011-2012 The PPCoin Developers Copyright © 2014 The Peerunity Developers Copyright © 2014 The EmerCoin Developers -Copyright © 2012-2015 The NovaCoin developers +Copyright © 2012-2016 The NovaCoin developers Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse diff --git a/src/qt/locale/bitcoin_en.ts b/src/qt/locale/bitcoin_en.ts index 8faa68a..caffb38 100644 --- a/src/qt/locale/bitcoin_en.ts +++ b/src/qt/locale/bitcoin_en.ts @@ -15,16 +15,16 @@ - Copyright © 2009-2015 The Bitcoin developers + Copyright © 2009-2016 The Bitcoin developers Copyright © 2011-2012 The PPCoin Developers Copyright © 2014 The Peerunity Developers Copyright © 2014 The EmerCoin Developers -Copyright © 2012-2015 The NovaCoin developers - Copyright © 2009-2015 The Bitcoin developers +Copyright © 2012-2016 The NovaCoin developers + Copyright © 2009-2016 The Bitcoin developers Copyright © 2011-2012 The PPCoin Developers Copyright © 2014 The Peerunity Developers Copyright © 2014 The EmerCoin Developers -Copyright © 2012-2015 The NovaCoin developers +Copyright © 2012-2016 The NovaCoin developers diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index 89275bb..39e24e6 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -15,16 +15,16 @@ - Copyright © 2009-2015 The Bitcoin developers + Copyright © 2009-2016 The Bitcoin developers Copyright © 2011-2012 The PPCoin Developers Copyright © 2014 The Peerunity Developers Copyright © 2014 The EmerCoin Developers -Copyright © 2012-2015 The NovaCoin developers - Все права защищены © 2009-2015 Разработчики Bitcoin +Copyright © 2012-2016 The NovaCoin developers + Все права защищены © 2009-2016 Разработчики Bitcoin Все права защищены © 2011-2012 Разработчики PPCoin Все права защищены © 2014 Разработчики Peerunity Все права защищены © 2014 Разработчики EmerCoin -Все права защищены © 2012-2015 Разработчики NovaCoin +Все права защищены © 2012-2016 Разработчики NovaCoin diff --git a/src/qt/locale/bitcoin_uk.ts b/src/qt/locale/bitcoin_uk.ts index 6634540..71e2f08 100644 --- a/src/qt/locale/bitcoin_uk.ts +++ b/src/qt/locale/bitcoin_uk.ts @@ -15,16 +15,16 @@ - Copyright © 2009-2015 The Bitcoin developers + Copyright © 2009-2016 The Bitcoin developers Copyright © 2011-2012 The PPCoin Developers Copyright © 2014 The Peerunity Developers Copyright © 2014 The EmerCoin Developers -Copyright © 2012-2015 The NovaCoin developers - © 2009-2015 Розробники Bitcoin +Copyright © 2012-2016 The NovaCoin developers + © 2009-2016 Розробники Bitcoin © 2011-2012 Розробники PPCoin © 2014 Розробники Peerunity © 2014 Розробники EmerCoin -© 2012-2015 Розробники NovaCoin +© 2012-2016 Розробники NovaCoin diff --git a/src/script.cpp b/src/script.cpp index 8057bdb..ebf378e 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1306,7 +1306,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector& multisigdata, const CKeyStore& keystore, uint256 hash, int nHashType, CScript& scriptSigRet) +bool SignN(const vector& multisigdata, const CKeyStore& keystore, const uint256& hash, int nHashType, CScript& scriptSigRet) { int nSigned = 0; int nRequired = multisigdata.front()[0]; @@ -1341,7 +1341,7 @@ bool SignN(const vector& multisigdata, const CKeyStore& keystore, uint2 // unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. // Returns false if scriptPubKey could not be completely satisfied. // -bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, +bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, const uint256& hash, int nHashType, CScript& scriptSigRet, txnouttype& whichTypeRet) { scriptSigRet.clear(); @@ -1700,7 +1700,7 @@ static CScript PushAll(const vector& values) return result; } -static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, +static CScript CombineMultisig(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const vector& vSolutions, vector& sigs1, vector& sigs2) { @@ -1755,7 +1755,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CTransaction& txTo, u return result; } -static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, +static CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const txnouttype txType, const vector& vSolutions, vector& sigs1, vector& sigs2) { @@ -1800,7 +1800,7 @@ static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, return CScript(); } -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, +CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2) { txnouttype txType; diff --git a/src/script.h b/src/script.h index 745f848..3016911 100644 --- a/src/script.h +++ b/src/script.h @@ -617,6 +617,6 @@ bool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const C // Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, // combine them intelligently and return the result. -CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); +CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); #endif