Skip to content

Commit 5be35d6

Browse files
StealthSendStealthSend
authored andcommitted
removing tx timestamps & txid malleability
1 parent 4eb5c16 commit 5be35d6

38 files changed

Lines changed: 860 additions & 575 deletions

Stealth.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ win32 {
1818

1919
TEMPLATE = app
2020
TARGET = "Stealth Qt"
21-
VERSION = 2.1.0.3
21+
VERSION = 2.2.0.0
2222
INCLUDEPATH += src src/json src/qt src/tor
2323
INCLUDEPATH += src/tor/adapter src/tor/common src/tor/ext
2424
INCLUDEPATH += src/tor/ext/curve25519_donna src/tor/ext/ed25519/donna

contrib/macdeploy/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
<key>CFBundlePackageType</key>
1010
<string>APPL</string>
1111
<key>CFBundleGetInfoString</key>
12-
<string>Stealth [XST] Complete Anonymity 2.1.0.3</string>
12+
<string>StealthCoin [XST] Complete Anonymity 2.2.0.0</string>
1313
<key>CFBundleExecutable</key>
1414
<string>Stealth Qt</string>
1515
<key>CFBundleIdentifier</key>
1616
<string>org.stealth.stealth-qt</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>2.1.0.3</string>
18+
<string>2.2.0.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>oXST</string>
2121
<key>CFBundleVersion</key>
22-
<string>2.1.0.3</string>
22+
<string>2.2.0.0</string>
2323
</dict>
2424
</plist>

src/alert.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ std::string CUnsignedAlert::ToString() const
6262
return strprintf(
6363
"CAlert(\n"
6464
" nVersion = %d\n"
65-
" nRelayUntil = %"PRI64d"\n"
66-
" nExpiration = %"PRI64d"\n"
65+
" nRelayUntil = %" PRI64d "\n"
66+
" nExpiration = %" PRI64d "\n"
6767
" nID = %d\n"
6868
" nCancel = %d\n"
6969
" setCancel = %s\n"

src/bignum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ class CBigNum
9595
CBigNum(signed char n) { init(); if (n >= 0) setulong(n); else setint64(n); }
9696
CBigNum(short n) { init(); if (n >= 0) setulong(n); else setint64(n); }
9797
CBigNum(int n) { init(); if (n >= 0) setulong(n); else setint64(n); }
98-
CBigNum(long n) { init(); if (n >= 0) setulong(n); else setint64(n); }
98+
// CBigNum(long n) { init(); if (n >= 0) setulong(n); else setint64(n); }
9999
CBigNum(int64 n) { init(); setint64(n); }
100100
CBigNum(unsigned char n) { init(); setulong(n); }
101101
CBigNum(unsigned short n) { init(); setulong(n); }
102102
CBigNum(unsigned int n) { init(); setulong(n); }
103-
CBigNum(size_t n) { init(); setulong((unsigned int) n); }
103+
// CBigNum(size_t n) { init(); setulong((unsigned int) n); }
104104
// CBigNum(unsigned long n) { init(); setulong(n); }
105105
CBigNum(uint64 n) { init(); setuint64(n); }
106106
explicit CBigNum(uint256 n) { init(); setuint256(n); }

src/bitcoinrpc.cpp

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static string HTTPReply(int nStatus, const string& strMsg, bool keepalive)
403403
"HTTP/1.1 %d %s\r\n"
404404
"Date: %s\r\n"
405405
"Connection: %s\r\n"
406-
"Content-Length: %"PRIszu"\r\n"
406+
"Content-Length: %" PRIszu "\r\n"
407407
"Content-Type: application/json\r\n"
408408
"Server: StealthCoin-json-rpc/%s\r\n"
409409
"\r\n"
@@ -553,25 +553,33 @@ void ErrorReply(std::ostream& stream, const Object& objError, const Value& id)
553553
bool ClientAllowed(const boost::asio::ip::address& address)
554554
{
555555
// Make sure that IPv4-compatible and IPv4-mapped IPv6 addresses are treated as IPv4 addresses
556-
if (address.is_v6()
557-
&& (address.to_v6().is_v4_compatible()
558-
|| address.to_v6().is_v4_mapped()))
556+
if (address.is_v6() &&
557+
(address.to_v6().is_v4_compatible() ||
558+
address.to_v6().is_v4_mapped()))
559+
{
559560
return ClientAllowed(address.to_v6().to_v4());
561+
}
560562

561-
std::string ipv4addr = address.to_string();
563+
std::string ipv4addr = address.to_string();
562564

563-
if (address == asio::ip::address_v4::loopback()
564-
|| address == asio::ip::address_v6::loopback()
565-
|| (address.is_v4()
565+
if ((address == asio::ip::address_v4::loopback()) ||
566+
(address == asio::ip::address_v6::loopback()) ||
567+
(address.is_v4() &&
566568
// Check whether IPv4 addresses match 127.0.0.0/8 (loopback subnet)
567-
&& (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000))
569+
(address.to_v4().to_ulong() & 0xff000000) == 0x7f000000))
570+
{
568571
return true;
572+
}
569573

570574
const string strAddress = address.to_string();
571575
const vector<string>& vAllow = mapMultiArgs["-rpcallowip"];
572576
BOOST_FOREACH(string strAllow, vAllow)
577+
{
573578
if (WildcardMatch(strAddress, strAllow))
579+
{
574580
return true;
581+
}
582+
}
575583
return false;
576584
}
577585

src/checkpoints.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,6 @@ namespace Checkpoints
375375
return (nBestHeight >= pindexSync->nHeight + nCoinbaseMaturity ||
376376
pindexSync->GetBlockTime() + nStakeMinAge < GetAdjustedTime());
377377
}
378-
379-
// Is the sync-checkpoint too old?
380-
bool IsSyncCheckpointTooOld(unsigned int nSeconds)
381-
{
382-
LOCK(cs_hashSyncCheckpoint);
383-
// sync-checkpoint should always be accepted block
384-
assert(mapBlockIndex.count(hashSyncCheckpoint));
385-
const CBlockIndex* pindexSync = mapBlockIndex[hashSyncCheckpoint];
386-
return (pindexSync->GetBlockTime() + nSeconds < GetAdjustedTime());
387-
}
388378
}
389379

390380
// stealth: sync-checkpoint master key (520 bits, 130 hex)

src/checkpoints.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ namespace Checkpoints
4444
bool SetCheckpointPrivKey(std::string strPrivKey);
4545
bool SendSyncCheckpoint(uint256 hashCheckpoint);
4646
bool IsMatureSyncCheckpoint();
47-
bool IsSyncCheckpointTooOld(unsigned int nSeconds);
4847
}
4948

5049
// ppcoin: synchronized checkpoint

src/clientversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
99
#define CLIENT_VERSION_MAJOR 2
10-
#define CLIENT_VERSION_MINOR 1
10+
#define CLIENT_VERSION_MINOR 2
1111
#define CLIENT_VERSION_REVISION 0
12-
#define CLIENT_VERSION_BUILD 4
12+
#define CLIENT_VERSION_BUILD 0
1313

1414
// Converts the parameter X to a string after macro replacement on X has been performed.
1515
// Don't merge these into one macro!

src/db.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ void CDBEnv::Flush(bool fShutdown)
462462
else
463463
mi++;
464464
}
465-
printf("DBFlush(%s)%s ended %15"PRI64d"ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
465+
printf("DBFlush(%s)%s ended %15" PRI64d "ms\n", fShutdown ? "true" : "false", fDbEnvInit ? "" : " db not started", GetTimeMillis() - nStart);
466466
if (fShutdown)
467467
{
468468
char** listp;

src/init.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ bool AppInit2()
861861
printf("Shutdown requested. Exiting.\n");
862862
return false;
863863
}
864-
printf(" block index %15"PRI64d"ms\n", GetTimeMillis() - nStart);
864+
printf(" block index %15" PRI64d "ms\n", GetTimeMillis() - nStart);
865865

866866
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
867867
{
@@ -952,7 +952,7 @@ bool AppInit2()
952952
}
953953

954954
printf("%s", strErrors.str().c_str());
955-
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
955+
printf(" wallet %15" PRI64d "ms\n", GetTimeMillis() - nStart);
956956

957957
RegisterWallet(pwalletMain);
958958

@@ -972,7 +972,7 @@ bool AppInit2()
972972
printf("Rescanning last %i blocks (from block %i)...\n", pindexBest->nHeight - pindexRescan->nHeight, pindexRescan->nHeight);
973973
nStart = GetTimeMillis();
974974
pwalletMain->ScanForWalletTransactions(pindexRescan, true);
975-
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
975+
printf(" rescan %15" PRI64d "ms\n", GetTimeMillis() - nStart);
976976
}
977977

978978
// ********************************************************* Step 9: import blocks
@@ -1013,7 +1013,7 @@ bool AppInit2()
10131013
printf("Invalid or missing peers.dat; recreating\n");
10141014
}
10151015

1016-
printf("Loaded %i addresses from peers.dat %"PRI64d"ms\n",
1016+
printf("Loaded %i addresses from peers.dat %" PRI64d "ms\n",
10171017
addrman.size(), GetTimeMillis() - nStart);
10181018

10191019
// ********************************************************* Step 11: start node
@@ -1024,11 +1024,11 @@ bool AppInit2()
10241024
RandAddSeedPerfmon();
10251025

10261026
//// debug print
1027-
printf("mapBlockIndex.size() = %"PRIszu"\n", mapBlockIndex.size());
1027+
printf("mapBlockIndex.size() = %" PRIszu "\n", mapBlockIndex.size());
10281028
printf("nBestHeight = %d\n", nBestHeight);
1029-
printf("setKeyPool.size() = %"PRIszu"\n", pwalletMain->setKeyPool.size());
1030-
printf("mapWallet.size() = %"PRIszu"\n", pwalletMain->mapWallet.size());
1031-
printf("mapAddressBook.size() = %"PRIszu"\n", pwalletMain->mapAddressBook.size());
1029+
printf("setKeyPool.size() = %" PRIszu "\n", pwalletMain->setKeyPool.size());
1030+
printf("mapWallet.size() = %" PRIszu "\n", pwalletMain->mapWallet.size());
1031+
printf("mapAddressBook.size() = %" PRIszu "\n", pwalletMain->mapAddressBook.size());
10321032

10331033
if (!NewThread(StartNode, NULL))
10341034
InitError(_("Error: could not start node"));

0 commit comments

Comments
 (0)