Commit Graph

42 Commits

Author SHA1 Message Date
Kris Nuttycombe 3cec519ce4 scripted-diff: Update Zcash copyrights to 2023
-BEGIN VERIFY SCRIPT-
for party in "The Zcash developers" "The Bitcoin Core developers" "Bitcoin Developers"; do
  sed -i"" -e "s#Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? $party#Copyright (c) \1-2023 $party#" COPYING
  sed -i"" -e "s#\(.*\)\([0-9]\{4\}\)\(-[0-9]\{4\}\)\, $party#\1\2-2023, $party#" contrib/debian/copyright
done

sed -i"" -e "s/define(_COPYRIGHT_YEAR, [0-9]\{4\})/define(_COPYRIGHT_YEAR, 2023)/" configure.ac
sed -i"" -e "s/#define COPYRIGHT_YEAR [0-9]\{4\}/#define COPYRIGHT_YEAR 2023/" src/clientversion.h

git grep "^// Copyright (c) .* The Zcash developers" \
  | awk -F ':' '{print $1}' \
  | xargs -I {} sed -i"" -e "s#// Copyright (c) \([0-9]\{4\}\)\(-[0-9]\{4\}\)\? The Zcash developers#// Copyright (c) \1-2023 The Zcash developers#" {}
-END VERIFY SCRIPT-
2023-01-23 11:31:54 -07:00
Jim Posen 9a7e2c153d scripted-diff: Move util files to separate directory.
-BEGIN VERIFY SCRIPT-
mkdir -p src/util
git mv src/util.h src/util/system.h
git mv src/util.cpp src/util/system.cpp
git mv src/utilmoneystr.h src/util/moneystr.h
git mv src/utilmoneystr.cpp src/util/moneystr.cpp
git mv src/utilstrencodings.h src/util/strencodings.h
git mv src/utilstrencodings.cpp src/util/strencodings.cpp
git mv src/utiltime.h src/util/time.h
git mv src/utiltime.cpp src/util/time.cpp

sed -i -e 's/"util\.h"/"util\/system\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
git checkout HEAD -- src/secp256k1 # exclude secp256k1, which has its own "util.h"
sed -i -e 's/"utilmoneystr\.h"/"util\/moneystr\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/"utilstrencodings\.h"/"util\/strencodings\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp')
sed -i -e 's/"utiltime\.h"/"util\/time\.h"/g' $(git ls-files 'src/*.h' 'src/*.cpp')

sed -i -e 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h
sed -i -e 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h
sed -i -e 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h
sed -i -e 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h

sed -i -e 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am
sed -i -e 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am
sed -i -e 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am
sed -i -e 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am

sed -i -e 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i -e 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh
sed -i -e 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh
-END VERIFY SCRIPT-
2022-07-01 17:50:09 -06:00
Kris Nuttycombe 940dd0d426 scripted-diff: Add 2019-2022 copyright headers for files added/modified in 2019
-BEGIN VERIFY SCRIPT-
grep -l "Copyright" $(grep -L "The Zcash developers" $(git diff --name-only --diff-filter=ACM 8df7a073ce13ec057b94b5a813bb5534cdfa6809..6a08c225674df23f1c7f214bcb94732dba688d39 -- src/ test/ zcutil/ qa/)) | xargs -I {} sed -i"" -e "s#\(\(.*\)Copyright (c) .* The Bitcoin Core developers\)#\1\n\2Copyright (c) 2019-2022 The Zcash developers#" {}
-END VERIFY SCRIPT-
2022-05-11 17:29:59 -06:00
Jack Grigg 95280c10b0 Add named constants for legacy tx authDigest placeholder value 2021-09-14 21:26:05 +01:00
Jack Grigg d715f4ecac Implement CInv message type MSG_WTX
This adds the double-hash message variant. The extra hash field is set
to null for block message types, and to all-ones for MSG_TX (to match
the legacy authHash value used for pre-v5 transactions in the Merkle
tree).
2021-09-10 21:46:05 +01:00
Wladimir J. van der Laan e5bef4962b net: Consistent checksum handling
In principle, the checksums of P2P packets are simply 4-byte blobs which
are the first four bytes of SHA256(SHA256(payload)).

Currently they are handled as little-endian 32-bit integers half of the
time, as blobs the other half, sometimes copying the one to the other,
resulting in somewhat confused code.

This PR changes the handling to be consistent both at packet creation
and receiving, making it (I think) easier to understand.

(cherry picked from commit bitcoin/bitcoin@41e58faf04)
2021-08-13 15:42:04 +01:00
Alex Morcos 6d8962b055 tidy up CInv::GetCommand
(cherry picked from commit sipa/bitcoin@97d7402c2c)
2021-08-13 15:42:04 +01:00
Eric Lombrozo cf7e89bb8e Removed ppszTypeName from protocol.cpp
(cherry picked from commit sipa/bitcoin@e35d0200eb)
2021-08-13 15:42:04 +01:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
Pieter Wuille 1d5b47a903 nLastTry is only used for addrman entries
No need to define it for every CAddress, as it's memory only anyway.
2015-04-19 11:10:23 -07:00
Cory Fields eec37136fd make CMessageHeader a dumb storage class
It shouldn't know or care about bitcoind's chain param selection
2015-02-25 18:44:49 -05:00
Pavel Janík 5262fde0ec Remove whitespaces before double colon in errors and logs 2015-01-31 17:38:28 -05:00
Wladimir J. van der Laan 4f1524966a Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(),
x==0 with IsNull(), x!=0 with !IsNull().
Replace uses of uint256(0) with uint256().
2015-01-05 15:45:34 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Michael Ford 78253fcbad Remove references to X11 licence 2014-12-16 15:56:50 +08:00
Cory Fields 85c579e3a6 script: add a slew of includes all around and drop includes from script.h
Lots of files ended up with indirect includes from script.h.
2014-10-17 13:44:57 -04:00
Wladimir J. van der Laan 62e5f8f961 CMessageHeader sanity changes
- Remove spurious `pchCommand[1] = 1` in CMessageHeader()
- Make sure that pchCommand is zero-padded if length is shorter than
  COMMAND_SIZE
- Use strnlen to determine length of pcmCommand in GetCommand
2014-09-18 10:15:48 +02:00
Wladimir J. van der Laan 3802224110 Remove all other print() methods
All unused.
2014-08-20 20:54:27 +02:00
jtimon c8c52de3a0 Replace virtual methods with static attributes, chainparams.h depends on
protocol.h instead of the other way around
2014-06-04 13:29:36 +02:00
gubatron 57702541a2 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014.
contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
2014-02-09 21:06:06 -05:00
Wladimir J. van der Laan 7d9d134bf9 Remove redundant .c_str()s
After the tinyformat switch sprintf() family functions support passing
actual std::string objects.

Remove unnecessary c_str calls (236 of them) in logging and formatting.
2014-01-23 16:05:01 +01:00
Philip Kaufmann 379778bde6 core: remove includes in .cpp, if header is already in .h
- example: if util.h includes stdint.h, remove it from util.cpp, as
  util.h is the first header included in util.cpp
2013-11-15 12:20:16 +01:00
Brandon Dahler 51ed9ec971 Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
2013-11-10 09:36:28 -06:00
super3 db0e8ccd90 Bump Year Number to 2013 2013-10-20 15:25:06 -04:00
Gavin Andresen 881a85a22d Replace printf with LogPrintf / LogPrint 2013-09-18 20:39:25 +10:00
Mike Hearn 0e4b317555 Introduce a CChainParameters singleton class and regtest mode.
The new class is accessed via the Params() method and holds
most things that vary between main, test and regtest networks.
The regtest mode has two purposes, one is to run the
bitcoind/bitcoinj comparison tool which compares two separate
implementations of the Bitcoin protocol looking for divergence.

The other is that when run, you get a local node which can mine
a single block instantly, which is highly convenient for testing
apps during development as there's no need to wait 10 minutes for
a block on the testnet.
2013-06-19 16:28:52 +02:00
Eric Lombrozo 663224c232 Removed net.cpp's dependency on init.h.
Added explicit include of main.h in init.cpp, changed include of init.h to include of main.h in net.cpp.

Added function registration for net.cpp in init.cpp's network initialization.

Removed protocol.cpp's dependency on main.h.

TODO: Remove main.h include in net.cpp.
2013-06-05 20:36:10 -07:00
Pieter Wuille 1c06aa98c6 Always print full hashes (tx, block, inv) 2013-04-07 03:43:55 +02:00
Matt Corallo b02ddbedcb Relay CMerkleBlocks when asked for MSG_FILTERED_BLOCK 2013-01-16 12:48:02 -05:00
Luke Dashjr f3a84c3a6b Abstract block hash substr extraction (for debug.log) into BlockHashStr inline 2012-11-13 21:18:32 +00:00
Fordy 3a25a2b9b0 Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-18 22:02:28 +08:00
Jeff Garzik 1d8c7a9557 Add casts for unavoidable signed/unsigned comparisons
At these code sites, it is preferable to cast rather than change
a variable's type.
2012-04-23 14:14:36 -04:00
Jeff Garzik c376ac359e Fix loop index var types, fixing many minor sign comparison warnings
foo.size() typically returns an unsigned integral type; make loop variables
match those types' signedness.
2012-04-15 16:52:09 -04:00
Gavin Andresen 882164196e Update all copyrights to 2012 2012-02-07 11:28:30 -05:00
Pieter Wuille 67a42f929b Network stack refactor
This introduces CNetAddr and CService, respectively wrapping an
(IPv6) IP address and an IP+port combination. This functionality used
to be part of CAddress, which also contains network flags and
connection attempt information. These extra fields are however not
always necessary.

These classes, along with logic for creating connections and doing
name lookups, are moved to netbase.{h,cpp}, which does not depend on
headers.h.

Furthermore, CNetAddr is mostly IPv6-ready, though IPv6
functionality is not yet enabled for the application itself.
2012-01-06 18:55:37 +01:00
Wladimir J. van der Laan bde280b9a4 Revert "Use standard C99 (and Qt) types for 64-bit integers"
This reverts commit 21d9f36781.
2011-12-21 22:33:19 +01:00
Luke Dashjr 21d9f36781 Use standard C99 (and Qt) types for 64-bit integers 2011-12-20 16:52:59 -05:00
Gavin Andresen 26ce92b352 Use std::numeric_limits<> for typesafe INT_MAX/etc 2011-12-19 19:10:34 -05:00
Gavin Andresen 6853e627f1 Fix build on windows and mac
Replaced all occurrences of #if* __WXMSW__ with WIN32,
and all occurrences of __WXMAC_OSX__ with MAC_OSX, and made
sure those are defined appropriately in the makefile and bitcoin-qt.pro.
2011-10-07 11:02:21 -04:00
Giel van Schijndel e4dde849ae Move CInv to protocol.[ch]pp
This commit does *not* and should not modify *any* code, it only moves
it from net.h and splits it across protocol.cpp and protocol.hpp.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2011-08-19 07:24:38 +02:00
Giel van Schijndel 33e28c9948 Move CAddress to protocol.[ch]pp
This commit does *not* and should not modify *any* code, it only moves
it from net.h and splits it across protocol.cpp and protocol.hpp.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2011-08-19 07:24:38 +02:00
Giel van Schijndel 507fd9d15b Start moving protocol-specific code to protocol.[ch]pp
Move CMessageHeader from net.h to protocol.[ch]pp, with the
implementation in the .cpp compilation unit (compiling once is enough).

This commit does *not* and should not modify *any* code, it only moves
it from net.h and splits it across protocol.cpp and protocol.hpp.

Indentation changes aside the closest thing to a modification of code is
the addition of the 'TODO' comment (the execution of which requires code
modifications and thus doesn't belong in this commit).

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2011-08-19 07:24:38 +02:00