Skip to content

Commit

Permalink
Merge branch master into core26
Browse files Browse the repository at this point in the history
  • Loading branch information
timemarkovqtum committed Apr 22, 2024
2 parents 43cd44a + 0aaac44 commit e3be211
Show file tree
Hide file tree
Showing 45 changed files with 219 additions and 182 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,33 @@ Qtum uses a tool called Gitian to make reproducible builds that can be verified

This is a quick start script for compiling Qtum on Ubuntu


sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev libgmp3-dev
```bash
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev libgmp3-dev bison libtool-bin
sudo apt-get install software-properties-common

# If you want to build the Qt GUI:
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode

git clone https://github.com/qtumproject/qtum --recursive
git clone https://github.com/qtumproject/qtum
cd qtum
git submodule update --init --recursive

./contrib/install_db4.sh `pwd`
export BDB_PREFIX='/path/to/qtum/db4'

cd depends
make

# replace x86_64-pc-linux-gnu with the appropriate folder name for your system
libtool --finish depends/x86_64-pc-linux-gnu/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/x86_64-pc-linux-gnu/lib

# Note autogen will prompt to install some more dependencies if needed
# Note: autogen will prompt to install some more dependencies if needed
./contrib/install_db4.sh `pwd`
./autogen.sh
./configure
make -j2
./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu
make -j$(nproc)
```

### Build on CentOS

Expand Down Expand Up @@ -207,9 +219,8 @@ Then install [Homebrew](https://brew.sh).

#### Dependencies

brew install cmake automake berkeley-db@4 libtool boost@1.76 miniupnpc openssl pkg-config protobuf qt@5 libevent imagemagick librsvg qrencode gmp
brew install cmake automake berkeley-db@4 libtool boost miniupnpc openssl pkg-config protobuf qt@5 libevent imagemagick librsvg qrencode gmp

After installing all dependencies, make sure to run "brew link [email protected]"
NOTE: This will work for building on Intel Macs and Apple Silicon Macs

NOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.
Expand Down
2 changes: 1 addition & 1 deletion doc/hardware-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Use [HWI](https://github.com/qtumproject/HWI) for command line interaction with

`qtum-qt` provides an interface for interacting with hardware wallet devices.

Set the HWI tool path using the the menu `Settings -> Option -> Main -> HWI Tool Path` and restart `qtum-qt`, the tool is needed for hardware wallet interaction.
Set the HWI tool path using the menu `Settings -> Option -> Main -> HWI Tool Path` and restart `qtum-qt`, the tool is needed for hardware wallet interaction.

Use the menu `File -> Create Wallet... -> Use a hardware device` for creating hardware wallet. The hardware wallet needs to be connected and the wallet application started.

Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/Install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The following are some of the targets provided by the GNU makefile.

`make cryptest.exe` builds the library test harness.

`make test` and `make check` are the same recipe and invoke the test harness with the the validation option. That is, it executes `cryptest.exe v`.
`make test` and `make check` are the same recipe and invoke the test harness with the validation option. That is, it executes `cryptest.exe v`.

`make install` installs the library. By default, the makefile copies into `/usr/local` by default.

Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/TestScripts/setenv-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ fi

echo
echo "*******************************************************************************"
echo "It looks the the environment is set correctly. Your next step is"
echo "It looks the environment is set correctly. Your next step is"
echo "build the library with 'make -f GNUmakefile-cross'"
echo "*******************************************************************************"
echo
Expand Down
4 changes: 2 additions & 2 deletions src/cryptopp/TestScripts/setenv-embedded.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fi
# IS_LINUX or IS_DARWIN, and incorporate settings for ARM_EMBEDDED
export IS_ARM_EMBEDDED=1

# GNUmakefile-cross uses these to to set CXXFLAGS for ARM_EMBEDDED
# GNUmakefile-cross uses these to set CXXFLAGS for ARM_EMBEDDED
if [ -z "$ARM_EMBEDDED_SYSROOT" ]; then
export ARM_EMBEDDED_SYSROOT="/usr/arm-linux-gnueabi"
fi
Expand Down Expand Up @@ -134,7 +134,7 @@ fi

echo
echo "*******************************************************************************"
echo "It looks the the environment is set correctly. Your next step is"
echo "It looks the environment is set correctly. Your next step is"
echo "build the library with 'make -f GNUmakefile-cross'"
echo "*******************************************************************************"
echo
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/TestScripts/setenv-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fi

echo
echo "*******************************************************************************"
echo "It looks the the environment is set correctly. Your next step is"
echo "It looks the environment is set correctly. Your next step is"
echo "build the library with 'make -f GNUmakefile-cross'"
echo "*******************************************************************************"
echo
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/algebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ template <class T> class CRYPTOPP_NO_VTABLE AbstractEuclideanDomain : public Abs
//! \brief Calculates the greatest common denominator in the ring
//! \param a the first element
//! \param b the second element
//! \returns the the greatest common denominator of a and b.
//! \returns the greatest common denominator of a and b.
virtual const Element& Gcd(const Element &a, const Element &b) const;

protected:
Expand Down
4 changes: 2 additions & 2 deletions src/cryptopp/algparam.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class CRYPTOPP_DLL AlgorithmParametersBase
//! \param name the parameter name
//! \param throwIfNotUsed flags indicating whether an exception should be thrown
//! \details If throwIfNotUsed is true, then a ParameterNotUsed exception
//! will be thrown in the destructor if the parameter is not not retrieved.
//! will be thrown in the destructor if the parameter is not retrieved.
AlgorithmParametersBase(const char *name, bool throwIfNotUsed)
: m_name(name), m_throwIfNotUsed(throwIfNotUsed), m_used(false) {}

Expand Down Expand Up @@ -378,7 +378,7 @@ class AlgorithmParametersTemplate : public AlgorithmParametersBase
//! \param value a reference to the value
//! \param throwIfNotUsed flags indicating whether an exception should be thrown
//! \details If throwIfNotUsed is true, then a ParameterNotUsed exception
//! will be thrown in the destructor if the parameter is not not retrieved.
//! will be thrown in the destructor if the parameter is not retrieved.
AlgorithmParametersTemplate(const char *name, const T &value, bool throwIfNotUsed)
: AlgorithmParametersBase(name, throwIfNotUsed), m_value(value)
{
Expand Down
6 changes: 3 additions & 3 deletions src/cryptopp/cryptlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE AuthenticatedSymmetricCipher : public Mess
//! \brief Provides the maximum length of encrypted data
//! \return the maximum length of encrypted data
virtual lword MaxMessageLength() const =0;
//! \brief Provides the the maximum length of AAD
//! \brief Provides the maximum length of AAD
//! \return the maximum length of AAD that can be input after the encrypted data
virtual lword MaxFooterLength() const {return 0;}
//! \brief Determines if data lengths must be specified prior to inputting data
Expand Down Expand Up @@ -2382,7 +2382,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Decryptor : public PK_CryptoSystem, pub
//! \param parameters a set of NameValuePairs to initialize this object
//! \return the result of the decryption operation
//! \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength
//! is valid and holds the the actual length of the plaintext recovered. The result is undefined
//! is valid and holds the actual length of the plaintext recovered. The result is undefined
//! if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength
//! is undefined.
//! \pre <tt>COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength)</tt> ensures the output
Expand All @@ -2408,7 +2408,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE PK_Decryptor : public PK_CryptoSystem, pub
//! \param parameters a set of NameValuePairs to initialize this object
//! \return the result of the decryption operation
//! \details If DecodingResult::isValidCoding is true, then DecodingResult::messageLength
//! is valid and holds the the actual length of the plaintext recovered. The result is undefined
//! is valid and holds the actual length of the plaintext recovered. The result is undefined
//! if decryption failed. If DecodingResult::isValidCoding is false, then DecodingResult::messageLength
//! is undefined.
//! \pre <tt>COUNTOF(plaintext) == MaxPlaintextLength(ciphertextLength)</tt> ensures the output
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/des.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* This is a major rewrite of my old public domain DES code written
* circa 1987, which in turn borrowed heavily from Jim Gillogly's 1977
* public domain code. I pretty much kept my key scheduling code, but
* the actual encrypt/decrypt routines are taken from from Richard
* the actual encrypt/decrypt routines are taken from Richard
* Outerbridge's DES code as printed in Schneier's "Applied Cryptography."
*
* This code is in the public domain. I would appreciate bug reports and
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/ec2n.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CRYPTOPP_DLL EC2N : public AbstractGroup<EC2NPoint>, public EncodedPoint<E

//! \brief Construct an EC2N from BER encoded parameters
//! \param bt BufferedTransformation derived object
//! \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters
//! \details This constructor will decode and extract the fields fieldID and curve of the sequence ECParameters
EC2N(BufferedTransformation &bt);

//! \brief Encode the fields fieldID and curve of the sequence ECParameters
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/ecp.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CRYPTOPP_DLL ECP : public AbstractGroup<ECPPoint>, public EncodedPoint<ECP

//! \brief Construct an ECP from BER encoded parameters
//! \param bt BufferedTransformation derived object
//! \details This constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters
//! \details This constructor will decode and extract the fields fieldID and curve of the sequence ECParameters
ECP(BufferedTransformation &bt);

//! \brief Encode the fields fieldID and curve of the sequence ECParameters
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/nbtheory.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class CRYPTOPP_DLL PrimeAndGenerator
const Integer& SubPrime() const {return q;}

//! \brief Retrieve the generator
//! \returns Generator() returns the the generator g.
//! \returns Generator() returns the generator g.
const Integer& Generator() const {return g;}

private:
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/ossig.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C" {
//! \brief Null signal handler function
//! \param unused the signal number
//! \details NullSignalHandler is provided as a stand alone function with external "C" linkage
//! and not a static member function due to the the member function's implicit
//! and not a static member function due to the member function's implicit
//! external "C++" linkage.
//! \sa SignalHandler, SignalHandlerFn
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions src/cryptopp/pssr.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ template<> class PSSR_MEM_BaseWithHashId<false> : public PSSR_MEM_Base {};
//! \tparam SALT_LEN length of the salt
//! \tparam MIN_PAD_LEN minimum length of the pad
//! \tparam USE_HASH_ID flag indicating whether the HashId is used
//! \details If ALLOW_RECOVERY is true, the the signature scheme provides message recovery. If
//! ALLOW_RECOVERY is false, the the signature scheme is appendix, and the message must be
//! \details If ALLOW_RECOVERY is true, the signature scheme provides message recovery. If
//! ALLOW_RECOVERY is false, the signature scheme is appendix, and the message must be
//! provided during verification.
template <bool ALLOW_RECOVERY, class MGF=P1363_MGF1, int SALT_LEN=-1, int MIN_PAD_LEN=0, bool USE_HASH_ID=false>
class PSSR_MEM : public PSSR_MEM_BaseWithHashId<USE_HASH_ID>
Expand Down
8 changes: 4 additions & 4 deletions src/cryptopp/pubkey.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE TrapdoorFunctionBounds
//! \details The default implementation returns <tt>PreimageBound() - 1</tt>.
virtual Integer MaxPreimage() const {return --PreimageBound();}
//! \brief Returns the maximum size of a message after the trapdoor function is applied bound to a public key
//! \returns the the maximum size of a message after the trapdoor function is applied bound to a public key
//! \returns the maximum size of a message after the trapdoor function is applied bound to a public key
//! \details The default implementation returns <tt>ImageBound() - 1</tt>.
virtual Integer MaxImage() const {return --ImageBound();}
};
Expand Down Expand Up @@ -671,7 +671,7 @@ class CRYPTOPP_NO_VTABLE MaskGeneratingFunction
//! \brief Generate and apply mask
//! \param hash HashTransformation derived class
//! \param output the destination byte array
//! \param outputLength the size fo the the destination byte array
//! \param outputLength the size fo the destination byte array
//! \param input the message to hash
//! \param inputLength the size of the message
//! \param mask flag indicating whether to apply the mask
Expand All @@ -682,7 +682,7 @@ class CRYPTOPP_NO_VTABLE MaskGeneratingFunction
//! \brief P1363 mask generation function
//! \param hash HashTransformation derived class
//! \param output the destination byte array
//! \param outputLength the size fo the the destination byte array
//! \param outputLength the size fo the destination byte array
//! \param input the message to hash
//! \param inputLength the size of the message
//! \param derivationParams additional derivation parameters
Expand Down Expand Up @@ -915,7 +915,7 @@ class CRYPTOPP_NO_VTABLE DL_GroupParameters : public CryptoParameters
//! \brief Determines if an element is an identity
//! \param element element to check
//! \return true if the element is an identity, false otherwise
//! \details The identity element or or neutral element is a special element in a group that leaves
//! \details The identity element or neutral element is a special element in a group that leaves
//! other elements unchanged when combined with it.
//! \details IsIdentity() must be implemented in a derived class.
virtual bool IsIdentity(const Element &element) const =0;
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/setenv-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ fi

echo
echo "*******************************************************************************"
echo "It looks the the environment is set correctly. Your next step is build"
echo "It looks the environment is set correctly. Your next step is build"
echo "the library with 'make -f GNUmakefile-cross'. You can create a versioned"
echo "shared object using 'HAS_SOLIB_VERSION=1 make -f GNUmakefile-cross'"
echo "*******************************************************************************"
Expand Down
4 changes: 2 additions & 2 deletions src/cryptopp/setenv-embedded.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fi
# IS_LINUX or IS_DARWIN, and incorporate settings for ARM_EMBEDDED
export IS_ARM_EMBEDDED=1

# GNUmakefile-cross uses these to to set CXXFLAGS for ARM_EMBEDDED
# GNUmakefile-cross uses these to set CXXFLAGS for ARM_EMBEDDED
if [ -z "$ARM_EMBEDDED_SYSROOT" ]; then
export ARM_EMBEDDED_SYSROOT="/usr/arm-linux-gnueabi"
fi
Expand Down Expand Up @@ -134,7 +134,7 @@ fi

echo
echo "*******************************************************************************"
echo "It looks the the environment is set correctly. Your next step is build"
echo "It looks the environment is set correctly. Your next step is build"
echo "the library with 'make -f GNUmakefile-cross'. You can create a versioned"
echo "shared object using 'HAS_SOLIB_VERSION=1 make -f GNUmakefile-cross'"
echo "*******************************************************************************"
Expand Down
2 changes: 1 addition & 1 deletion src/cryptopp/setenv-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fi

echo
echo "*******************************************************************************"
echo "It looks the the environment is set correctly. Your next step is build"
echo "It looks the environment is set correctly. Your next step is build"
echo "the library with 'make -f GNUmakefile-cross'. You can create a versioned"
echo "shared object using 'HAS_SOLIB_VERSION=1 make -f GNUmakefile-cross'"
echo "*******************************************************************************"
Expand Down
2 changes: 1 addition & 1 deletion src/eth_client/libethcore/ChainOperationParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct ChainOperationParams
// returns schedule for the fork active at the given block
// may include additional individually activated EIPs on top of the last fork block
EVMSchedule const& scheduleForBlockNumber(u256 const& _blockNumber) const;
// returns schedule according to the the fork rules active at the given block
// returns schedule according to the fork rules active at the given block
// doesn't include additional individually activated EIPs
EVMSchedule const& forkScheduleForBlockNumber(u256 const& _blockNumber) const;
u256 blockReward(EVMSchedule const& _schedule) const;
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ class CUnitTestParams : public CRegTestParams
explicit CUnitTestParams(const RegTestOptions& opts)
: CRegTestParams(opts)
{
// Activate the the BIPs for regtest as in Bitcoin
// Activate the BIPs for regtest as in Bitcoin
consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)
consensus.BIP34Hash = uint256();
consensus.BIP65Height = consensus.nBlocktimeDownscaleFactor*500 + 851; // BIP65 activated on regtest (Used in rpc activation tests)
Expand Down
6 changes: 3 additions & 3 deletions src/key_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,15 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
std::vector<unsigned char> data;
uint160 hash;
error_str = "";
bech32::DecodeResult dec;

// Note this will be false if it is a valid Bech32 address for a different network
bool is_bech32 = (ToLower(str.substr(0, params.Bech32HRP().size())) == params.Bech32HRP());

// Decode bech32 address
if(is_bech32)
{
dec = bech32::Decode(str);
is_bech32 = dec.encoding != bech32::Encoding::INVALID;
// There are valid PKH addresses that start with Qc, so make sure it is not a valid PKH address
is_bech32 = !DecodeBase58Check(str, data, 21);
}

if (!is_bech32 && DecodeBase58Check(str, data, 21)) {
Expand Down Expand Up @@ -137,6 +136,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
}

data.clear();
const auto dec = bech32::Decode(str);
if (dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) {
if (dec.data.empty()) {
error_str = "Empty Bech32 data section";
Expand Down
2 changes: 1 addition & 1 deletion src/secp256k1/src/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ static int secp256k1_ecdsa_sign_inner(const secp256k1_context* ctx, secp256k1_sc
break;
}
is_nonce_valid = secp256k1_scalar_set_b32_seckey(&non, nonce32);
/* The nonce is still secret here, but it being invalid is is less likely than 1:2^255. */
/* The nonce is still secret here, but it being invalid is less likely than 1:2^255. */
secp256k1_declassify(ctx, &is_nonce_valid, sizeof(is_nonce_valid));
if (is_nonce_valid) {
ret = secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, r, s, &sec, &msg, &non, recid);
Expand Down
2 changes: 1 addition & 1 deletion test/functional/feature_bip68_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_sequence_lock_confirmed_inputs(self):
import random
num_outputs = random.randint(1, max_outputs)
self.wallet.send_self_transfer_multi(from_node=self.nodes[0], num_outputs=num_outputs)
self.generate(self.wallet, 1)
self.generate(self.wallet, COINBASE_MATURITY + 1)

utxos = self.wallet.get_utxos(include_immature_coinbase=False)

Expand Down
Loading

0 comments on commit e3be211

Please sign in to comment.