Compare commits

...

74 Commits
29.x ... v0.5.2

Author SHA1 Message Date
Luke Dashjr
7de7913abd Merge branch '0.5.0.x' into 0.5.x 2012-01-05 18:19:29 -05:00
Luke Dashjr
780a182317 Merge branch '0.4.x' into 0.5.0.x 2012-01-05 18:17:58 -05:00
Matt Corallo
99e9601e80 Fix horrific performance found by gmaxwell. 2012-01-05 12:11:28 -05:00
Wladimir J. van der Laan
45099b19da Fix transaction type in UI: not all tx'es with "from"/"to" field are necessarily IP tx'es
- Also, prepare for OP_EVAL by calling all transactions without bitcoin address "SendToOther"/"RecvFromOther",
 (IP tx'es are so rare they can be put together with funky EV_EVAL scripts)
2012-01-04 01:09:09 -05:00
Luke Dashjr
a2e9767225 Merge branch '0.5.0.x' into 0.5.x 2012-01-03 12:23:09 -05:00
Wladimir J. van der Laan
20e3f2aefc Fix typo (#734) 2012-01-03 12:23:07 -05:00
Luke Dashjr
fb88f1cc97 Fix typo (#734)
Conflicts:

	src/qt/locale/bitcoin_hu.ts
	src/qt/locale/bitcoin_it.ts
	src/qt/locale/bitcoin_pt_BR.ts
	src/qt/locale/bitcoin_uk.ts
	src/qt/locale/bitcoin_zh_CN.ts
2012-01-03 12:21:04 -05:00
Luke Dashjr
eb2a10afd6 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	src/util.cpp
2012-01-03 12:19:48 -05:00
Gavin Andresen
cc6bd19660 I broke -testnet with my TOR option-parsing fixes. 2012-01-03 12:17:54 -05:00
Gavin Andresen
84393f15b6 Fix issue #659, and cleanup wallet/command-line argument handling a bit
Conflicts:
	src/init.cpp
	src/util.cpp
2012-01-03 11:48:44 -05:00
Pieter Wuille
b52b6f2e38 Fix some address-handling deadlocks
Made three critical blocks for cs_mapAddresses smaller, and moved
writing to the database out of them. This should also improve the
concurrency of the code.
2012-01-02 20:05:58 -05:00
Luke Dashjr
a91a40febd Merge branch '0.5.0.x' into 0.5.x 2011-12-25 09:56:55 -05:00
Luke Dashjr
3b8051864b Be more conservative: check all transactions in blocks after last checkpoint. 2011-12-25 09:26:12 -05:00
Luke Dashjr
961cf14ab3 Merge branch '0.5.0.x' into 0.5.x 2011-12-23 10:09:13 -05:00
Matt Corallo
8632383161 Fix #722. 2011-12-23 10:09:02 -05:00
Luke Dashjr
ab4b52a239 Merge branch '0.4.x' into 0.5.0.x 2011-12-23 10:08:53 -05:00
Dylan Noblesmith
96f1723bb1 Implement an mlock()'d string class for storing passphrases
SecureString is identical to std::string except with secure_allocator
substituting for std::allocator. This makes casting between them
impossible, so converting between the two at API boundaries requires
calling ::c_str() for now.
2011-12-20 18:42:30 -05:00
Luke Dashjr
027d149352 Bugfix: fForRelay should be false when deciding required fee to include in blocks
During the rushed transition from 0.01 BTC to 0.0005 BTC fees, we took the
approach of dropping the relay and block-inclusion fee to 0.0005 BTC
immediately, and only delayed adjusting the sending fee for the next release.
Afterward, the relay fee was lowered to 0.0001 BTC to avoid having the same
problem in the future. However, the block inclusion code was left setting
fForRelay to true! This fixes that, so the lower 0.0001 BTC allowance is (as
intended) only permitted for real relaying.
2011-12-20 17:05:04 -05:00
Luke Dashjr
96c700f5e4 Merge branch '0.5.0.x' into 0.5.x 2011-12-19 16:05:32 -05:00
Luke Dashjr
f503a1486a Merge branch '0.4.x' into 0.5.0.x 2011-12-19 16:05:15 -05:00
Luke Dashjr
987f26aa1a Add my DNS seed domain 2011-12-19 14:38:26 -05:00
Matt Corallo
6be2c9b5b4 Add sipa's new dnsseed. 2011-12-19 14:38:22 -05:00
Luke Dashjr
7aa253d3ec Bump version to 0.5.2 2011-12-16 17:58:40 -05:00
Matt Corallo
9ea0699278 Update debian changelog to 0.5.1. 2011-12-16 17:55:44 -05:00
Luke Dashjr
f1a6d74775 Merge branch '0.5.0.x' into 0.5.x 2011-12-16 17:54:53 -05:00
Luke Dashjr
5fe2dbd7b6 Update debian changelog to 0.5.0.3. 2011-12-16 17:47:50 -05:00
Luke Dashjr
ace5ce05be Bump version to 0.5.0.3 2011-12-15 19:34:37 -05:00
Luke Dashjr
98c0b8b85e Bump version to 0.5.0.2 2011-12-15 19:32:15 -05:00
Luke Dashjr
1f53204045 Bump version to 0.4.3 2011-12-15 19:25:29 -05:00
Matt Corallo
181b863d22 Fix status bar not displaying Alerts. 2011-12-13 16:17:58 -05:00
Wladimir J. van der Laan
142e5056cd Enable wordwrap for long message in passphrase dialog
- Remove explicit resizing from constructor to prevent potential hang
2011-12-13 12:46:58 -05:00
Matt Corallo
9a7f4948c6 Re-enable RPCSSL in gitian builds. 2011-12-12 14:39:49 -05:00
Luke Dashjr
12c69167e3 Merge branch '0.4.x' into 0.5.x 2011-12-12 14:34:47 -05:00
Luke Dashjr
b379bc5eef Merge branch 'restore_old_miniupnp_compat' into 0.4.x 2011-12-12 14:33:47 -05:00
Matt Corallo
16e7c05de7 Move -lgdi32 after -lcrypto (fixes #681). 2011-12-05 11:08:48 -05:00
Matt Corallo
4c519a47a9 Move DNS Seed lookup to a new thread. 2011-12-02 12:56:26 -05:00
Matt Corallo
ba56a88ca5 Move DNS Seed lookup to a new thread. 2011-12-02 12:55:14 -05:00
Luke Dashjr
fe5cc3b7f8 Merge branch '0.4.x' into 0.5.x
(no actual changes)
2011-12-01 23:22:12 -05:00
Gavin Andresen
5d901f1ba0 Orphan block fill-up-memory attack prevention 2011-12-01 23:20:32 -05:00
Gavin Andresen
0e6425da4a Moved checkpoints out of main, to prep for using them to help prevent DoS attacks 2011-12-01 23:12:47 -05:00
Gavin Andresen
f8c3eb9568 Orphan block fill-up-memory attack prevention 2011-12-01 15:48:27 -05:00
Gavin Andresen
d27be1f557 Moved checkpoints out of main, to prep for using them to help prevent DoS attacks 2011-12-01 15:48:20 -05:00
Wladimir J. van der Laan
3741185a51 Make home and addressbook icon more consistent with other toolbar icons (make it blue and flip light source direction) 2011-12-01 03:56:33 -05:00
Gavin Andresen
cba18514c0 Add missing command-line arguments to --help/-? output 2011-12-01 03:55:59 -05:00
Gavin Andresen
a7d735dcc2 Add missing command-line arguments to --help/-? output 2011-12-01 03:55:26 -05:00
Wladimir J. van der Laan
094c35cffc allow for filtering addresses and labels by searching for the typed string anywhere, not just at the beginning (#641) 2011-11-25 09:05:58 -05:00
Luke Dashjr
b683118cd0 Merge branch '0.4.x' into 0.5.x
The only practical change here is updating the gitian URIs to the stable repository.
Otherwise, it just enables merging bugfixes from 0.4.x into 0.5.x properly.

Conflicts:
	contrib/Bitcoin.app/Contents/Info.plist
	doc/README
	doc/README_windows.txt
	doc/release-process.txt
	share/setup.nsi
	src/bitcoinrpc.cpp
	src/headers.h
	src/makefile.unix
	src/serialize.h
	src/ui.cpp
2011-11-24 19:26:52 -05:00
Nils Schneider
1c4be55a99 update translation: de 2011-11-24 19:20:49 -05:00
Alex B
7597fcd92f Small fixes in both spanish translations 2011-11-24 19:20:14 -05:00
Gavin Andresen
adb9f7ddde Don't forget to bump release numbers in READMEs next time 2011-11-21 15:36:15 -05:00
Gavin Andresen
99fe0af2fe Bump version numbers to 0.5.1 2011-11-21 15:36:10 -05:00
Gavin Andresen
45593c271a Don't forget to bump release numbers in READMEs next time 2011-11-21 15:34:20 -05:00
Luke Dashjr
d885aba347 Bump version to 0.4.2 2011-11-21 13:59:38 -05:00
Pieter Wuille
36b1eb7631 close old db when rewriting 2011-11-20 13:53:07 -05:00
Gavin Andresen
76ef6d89b9 Never remove database files on shutdown, it caused unreadable wallets on some testers' machines. 2011-11-20 13:52:59 -05:00
Gavin Andresen
c4a3bf9e55 Only remove database log files on shutdown after wallet encryption/rewrite 2011-11-17 14:29:18 -05:00
Gavin Andresen
90de05e88e Create new keypool for newly encrypted wallets. 2011-11-17 14:29:12 -05:00
Jeff Garzik
2bf36b4e7d Remove vladimir's DNS seed, at his request. 2011-11-15 17:39:38 -05:00
Gavin Andresen
831d24a19d Tweak handling of boost filesystem versions
(partial cherry pick)
2011-11-15 17:00:38 -05:00
Gavin Andresen
1aafd7464f Fix crash-on-osx-on-shutdown bug. And cleanup CDB handling in Rewrite. 2011-11-15 16:59:52 -05:00
Luke Dashjr
586ea168c2 add message about restarting bitcoin after encrypting wallet succesfully 2011-11-15 11:48:41 -05:00
Luke Dashjr
1179f6373d Update gitian descriptors to point at stable git repo 2011-11-15 10:33:26 -05:00
Gavin Andresen
0143c024af Fix boost filesystem incompatibility problem 2011-11-15 10:12:45 -05:00
Gavin Andresen
2744ea8c1f Obsolete keypool and make sure database removes log files on shutdown. 2011-11-15 10:11:53 -05:00
Pieter Wuille
00eae584a2 Resilvering 2011-11-15 10:03:31 -05:00
Matt Corallo
ef4280e08b Add returns to avoid annoying compile-time warnings. 2011-11-02 11:04:13 -04:00
Matt Corallo
ed176ba584 Only define __STDC_LIMIT_MACROS if not already defined. 2011-11-02 11:02:13 -04:00
cjdelisle
38a976d5bb Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded. 2011-11-02 10:59:48 -04:00
Gavin Andresen
b526cbaa71 bitcoind does not need to link with gthread-2.0 2011-10-10 16:18:58 -04:00
Luke Dashjr
aec5c5fe26 Bump version to 0.4.1 2011-10-10 14:22:31 -04:00
Victor Leschuk
600dc62559 Fix for 64bit build 2011-10-07 11:04:04 -04:00
Luke Dashjr
030d7acf7d Merge commit '65ba3e2f5024e1e38e119a0c25d5fc30c896cd65' into 0.4.x 2011-10-05 11:06:55 -04:00
Wladimir J. van der Laan
20cff2ade4 remove possibility of 63 bit overflow in ParseMoney 2011-10-01 19:04:24 -04:00
Luke Dashjr
7944d81567 Merge commit '3f94dfa' into stable 2011-09-26 15:37:57 -04:00
33 changed files with 233 additions and 137 deletions

View File

@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET =
VERSION = 0.5.1
VERSION = 0.5.2
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB
CONFIG += no_include_pwd

View File

@@ -1,3 +1,15 @@
bitcoin (0.5.2-natty0) natty; urgency=low
* New upstream release.
-- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Fri, 16 Dec 2011 17:57:00 -0500
bitcoin (0.5.1-natty0) natty; urgency=low
* New upstream release.
-- Matt Corallo <matt@bluematt.me> Fri, 16 Dec 2011 13:27:00 -0500
bitcoin (0.5.0-natty0) natty; urgency=low
* New upstream release.

View File

@@ -13,7 +13,7 @@ packages:
- "wine"
reference_datetime: "2011-01-30 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
- "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git"
"dir": "bitcoin"
files:
- "qt-win32-4.7.4-gitian.zip"

View File

@@ -18,7 +18,7 @@ packages:
- "unzip"
reference_datetime: "2011-01-30 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
- "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git"
"dir": "bitcoin"
files:
- "miniupnpc-1.6.tar.gz"
@@ -39,7 +39,7 @@ script: |
cp $OUTDIR/src/COPYING $OUTDIR
cd src
sed 's/$(DEBUGFLAGS)//' -i makefile.unix
make -f makefile.unix STATIC=1 DEFS="-I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0 USE_SSL=1
make -f makefile.unix STATIC=1 OPENSSL_INCLUDE_PATH="$INSTDIR/include" OPENSSL_LIB_PATH="$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0 USE_SSL=1
mkdir -p $OUTDIR/bin/$GBUILD_BITS
install -s bitcoind $OUTDIR/bin/$GBUILD_BITS
cd ..

View File

@@ -1,4 +1,4 @@
Bitcoin 0.5.1 BETA
Bitcoin 0.5.2 BETA
Copyright (c) 2009-2011 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying

View File

@@ -1,4 +1,4 @@
Bitcoin 0.5.1 BETA
Bitcoin 0.5.2 BETA
Copyright (c) 2009-2011 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying

View File

@@ -5,7 +5,7 @@ SetCompressor /SOLID lzma
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.5.1
!define VERSION 0.5.2
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
@@ -45,13 +45,13 @@ Var StartMenuGroup
!insertmacro MUI_LANGUAGE English
# Installer attributes
OutFile bitcoin-0.5.1-win32-setup.exe
OutFile bitcoin-0.5.2-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
VIProductVersion 0.5.1.0
VIProductVersion 0.5.2.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"

View File

@@ -190,6 +190,7 @@ bool AppInit2(int argc, char* argv[])
" -maxconnections=<n>\t " + _("Maintain at most <n> connections to peers (default: 125)\n") +
" -addnode=<ip> \t " + _("Add a node to connect to\n") +
" -connect=<ip> \t\t " + _("Connect only to the specified node\n") +
" -noirc \t " + _("Don't find peers using internet relay chat\n") +
" -nolisten \t " + _("Don't accept connections from outside\n") +
" -nodnsseed \t " + _("Don't bootstrap list of peers using DNS\n") +
" -banscore=<n> \t " + _("Threshold for disconnecting misbehaving peers (default: 100)\n") +
@@ -243,8 +244,8 @@ bool AppInit2(int argc, char* argv[])
return false;
}
fTestNet = GetBoolArg("-testnet");
fDebug = GetBoolArg("-debug");
fAllowDNS = GetBoolArg("-dns");
#ifndef WIN32
fDaemon = GetBoolArg("-daemon");
@@ -263,10 +264,6 @@ bool AppInit2(int argc, char* argv[])
#endif
fPrintToConsole = GetBoolArg("-printtoconsole");
fPrintToDebugger = GetBoolArg("-printtodebugger");
fTestNet = GetBoolArg("-testnet");
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
fNoListen = GetBoolArg("-nolisten") || fTOR;
fLogTimestamps = GetBoolArg("-logtimestamps");
#ifndef QT_GUI
@@ -328,16 +325,7 @@ bool AppInit2(int argc, char* argv[])
return false;
}
// Bind to the port early so we can tell if another instance is already running.
string strErrors;
if (!fNoListen)
{
if (!BindListenPort(strErrors))
{
wxMessageBox(strErrors, "Bitcoin");
return false;
}
}
//
// Load data files
@@ -424,6 +412,10 @@ bool AppInit2(int argc, char* argv[])
// Add wallet transactions that aren't already in a block to mapTransactions
pwalletMain->ReacceptWalletTransactions();
// Note: Bitcoin-QT stores several settings in the wallet, so we want
// to load the wallet BEFORE parsing command-line arguments, so
// the command-line/bitcoin.conf settings override GUI setting.
//
// Parameters
//
@@ -476,6 +468,42 @@ bool AppInit2(int argc, char* argv[])
}
}
bool fTor = (fUseProxy && addrProxy.port == htons(9050));
if (fTor)
{
// Use SoftSetArg here so user can override any of these if they wish.
// Note: the GetBoolArg() calls for all of these must happen later.
SoftSetArg("-nolisten", true);
SoftSetArg("-noirc", true);
SoftSetArg("-nodnsseed", true);
SoftSetArg("-noupnp", true);
SoftSetArg("-upnp", false);
SoftSetArg("-dns", false);
}
fAllowDNS = GetBoolArg("-dns");
fNoListen = GetBoolArg("-nolisten");
if (fHaveUPnP)
{
#if USE_UPNP
if (GetBoolArg("-noupnp"))
fUseUPnP = false;
#else
if (GetBoolArg("-upnp"))
fUseUPnP = true;
#endif
}
if (!fNoListen)
{
if (!BindListenPort(strErrors))
{
wxMessageBox(strErrors, "Bitcoin");
return false;
}
}
if (mapArgs.count("-addnode"))
{
BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
@@ -498,17 +526,6 @@ bool AppInit2(int argc, char* argv[])
wxMessageBox(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."), "Bitcoin", wxOK | wxICON_EXCLAMATION);
}
if (fHaveUPnP)
{
#if USE_UPNP
if (GetBoolArg("-noupnp"))
fUseUPnP = false;
#else
if (GetBoolArg("-upnp"))
fUseUPnP = true;
#endif
}
//
// Start the node
//

View File

@@ -264,19 +264,14 @@ void ThreadIRCSeed2(void* parg)
int nErrorWait = 10;
int nRetryWait = 10;
bool fNameInUse = false;
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
while (!fShutdown)
{
//CAddress addrConnect("216.155.130.130:6667"); // chat.freenode.net
CAddress addrConnect("92.243.23.21", 6667); // irc.lfnet.org
if (!fTOR)
{
//struct hostent* phostent = gethostbyname("chat.freenode.net");
CAddress addrIRC("irc.lfnet.org", 6667, true);
if (addrIRC.IsValid())
addrConnect = addrIRC;
}
CAddress addrIRC("irc.lfnet.org", 6667, true);
if (addrIRC.IsValid())
addrConnect = addrIRC;
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
@@ -406,10 +401,6 @@ void ThreadIRCSeed2(void* parg)
closesocket(hSocket);
hSocket = INVALID_SOCKET;
// IRC usually blocks TOR, so only try once
if (fTOR)
return;
if (GetTime() - nStart > 20 * 60)
{
nErrorWait /= 3;

View File

@@ -30,7 +30,6 @@ map<COutPoint, CInPoint> mapNextTx;
map<uint256, CBlockIndex*> mapBlockIndex;
uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32);
const int nInitialBlockThreshold = 120; // Regard blocks up until N-threshold as "initial download"
CBlockIndex* pindexGenesisBlock = NULL;
int nBestHeight = -1;
CBigNum bnBestChainWork = 0;
@@ -750,7 +749,7 @@ int GetNumBlocksOfPeers()
bool IsInitialBlockDownload()
{
if (pindexBest == NULL || nBestHeight < (Checkpoints::GetTotalBlocksEstimate()-nInitialBlockThreshold))
if (pindexBest == NULL || nBestHeight < Checkpoints::GetTotalBlocksEstimate())
return true;
static int64 nLastUpdate;
static CBlockIndex* pindexLastBest;
@@ -881,10 +880,10 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
if (pindex->nBlockPos == txindex.pos.nBlockPos && pindex->nFile == txindex.pos.nFile)
return error("ConnectInputs() : tried to spend coinbase at depth %d", pindexBlock->nHeight - pindex->nHeight);
// Skip ECDSA signature verification when connecting blocks (fBlock=true) during initial download
// (before the last blockchain checkpoint). This is safe because block merkle hashes are
// Skip ECDSA signature verification when connecting blocks (fBlock=true)
// before the last blockchain checkpoint. This is safe because block merkle hashes are
// still computed and checked, and any change will be caught at the next checkpoint.
if (!(fBlock && IsInitialBlockDownload()))
if (!(fBlock && (nBestHeight < Checkpoints::GetTotalBlocksEstimate())))
// Verify signature
if (!VerifySignature(txPrev, *this, i))
return DoS(100,error("ConnectInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str()));
@@ -2828,7 +2827,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
// Transaction fee required depends on block size
bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority));
int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, true);
int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree);
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency

View File

@@ -496,21 +496,25 @@ bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
void AddressCurrentlyConnected(const CAddress& addr)
{
CAddress *paddrFound = NULL;
CRITICAL_BLOCK(cs_mapAddresses)
{
// Only if it's been published already
map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey());
if (it != mapAddresses.end())
paddrFound = &(*it).second;
}
if (paddrFound)
{
int64 nUpdateInterval = 20 * 60;
if (paddrFound->nTime < GetAdjustedTime() - nUpdateInterval)
{
CAddress& addrFound = (*it).second;
int64 nUpdateInterval = 20 * 60;
if (addrFound.nTime < GetAdjustedTime() - nUpdateInterval)
{
// Periodically update most recently seen time
addrFound.nTime = GetAdjustedTime();
CAddrDB addrdb;
addrdb.WriteAddress(addrFound);
}
// Periodically update most recently seen time
paddrFound->nTime = GetAdjustedTime();
CAddrDB addrdb;
addrdb.WriteAddress(*paddrFound);
}
}
}
@@ -1225,6 +1229,8 @@ void MapPort(bool /* unused fMapPort */)
static const char *strDNSSeed[] = {
"bitseed.xf2.org",
"dnsseed.bluematt.me",
"seed.bitcoin.sipa.be",
"dnsseed.bitcoin.dashjr.org",
};
void ThreadDNSAddressSeed(void* parg)
@@ -1254,13 +1260,13 @@ void ThreadDNSAddressSeed2(void* parg)
if (!fTestNet)
{
printf("Loading addresses from DNS seeds (could take a while)\n");
CAddrDB addrDB;
addrDB.TxnBegin();
for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
vector<CAddress> vaddr;
if (Lookup(strDNSSeed[seed_idx], vaddr, NODE_NETWORK, -1, true))
{
CAddrDB addrDB;
addrDB.TxnBegin();
BOOST_FOREACH (CAddress& addr, vaddr)
{
if (addr.GetByte(3) != 127)
@@ -1270,10 +1276,9 @@ void ThreadDNSAddressSeed2(void* parg)
found++;
}
}
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
}
}
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
}
printf("%d addresses found from DNS seeds\n", found);
@@ -1445,27 +1450,31 @@ void ThreadOpenConnections2(void* parg)
if (fShutdown)
return;
bool fAddSeeds = false;
CRITICAL_BLOCK(cs_mapAddresses)
{
// Add seed nodes if IRC isn't working
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fTOR) && !fTestNet)
{
for (int i = 0; i < ARRAYLEN(pnSeed); i++)
{
// It'll only connect to one or two seed nodes because once it connects,
// it'll get a pile of addresses with newer timestamps.
// Seed nodes are given a random 'last seen time' of between one and two
// weeks ago.
const int64 nOneWeek = 7*24*60*60;
CAddress addr;
addr.ip = pnSeed[i];
addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
AddAddress(addr);
}
}
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fUseProxy) && !fTestNet)
fAddSeeds = true;
}
if (fAddSeeds)
{
for (int i = 0; i < ARRAYLEN(pnSeed); i++)
{
// It'll only connect to one or two seed nodes because once it connects,
// it'll get a pile of addresses with newer timestamps.
// Seed nodes are given a random 'last seen time' of between one and two
// weeks ago.
const int64 nOneWeek = 7*24*60*60;
CAddress addr;
addr.ip = pnSeed[i];
addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
AddAddress(addr);
}
}
//
// Choose an address to connect to based on most recently seen

View File

@@ -100,7 +100,7 @@
<item>
<widget class="QToolButton" name="addressBookButton">
<property name="toolTip">
<string>Choose adress from address book</string>
<string>Choose address from address book</string>
</property>
<property name="text">
<string/>

View File

@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Vælg adresse fra adressebog</translation>
</message>
<message>

View File

@@ -916,7 +916,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Adresse aus dem Adressbuch auswählen</translation>
</message>
<message>

View File

@@ -919,7 +919,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation type="unfinished"></translation>
</message>
<message>

View File

@@ -919,7 +919,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Elije dirección de la guia</translation>
</message>
<message>
@@ -2339,4 +2339,4 @@ pero la información de los comentarios quedará en blanco.</translation>
<translation>Bitcoin Qt</translation>
</message>
</context>
</TS>
</TS>

View File

@@ -919,7 +919,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Elije dirección de la guia</translation>
</message>
<message>
@@ -2339,4 +2339,4 @@ pero la información de los comentarios quedará en blanco.</translation>
<translation>Bitcoin Qt</translation>
</message>
</context>
</TS>
</TS>

View File

@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Válassz egy címet a címjegyzékből</translation>
</message>
<message>

View File

@@ -918,7 +918,7 @@ p, li { white-space: pre-wrap; }⏎
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Scegli l&apos;indirizzo dalla rubrica</translation>
</message>
<message>

View File

@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Velg adresse fra adresseboken</translation>
</message>
<message>

View File

@@ -918,7 +918,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Kies adres uit adresboek</translation>
</message>
<message>

View File

@@ -910,8 +910,8 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<translation>Choose adress from address book</translation>
<source>Choose address from address book</source>
<translation>Choose address from address book</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="113"/>

View File

@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Выбрать адрес из адресной книги</translation>
</message>
<message>

View File

@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Вибрати адресу з адресної книги</translation>
</message>
<message>

View File

@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation></translation>
</message>
<message>

View File

@@ -916,7 +916,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>簿</translation>
</message>
<message>

View File

@@ -64,17 +64,10 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
sub.credit = nUnmatured;
}
}
else if (!mapValue["from"].empty() || !mapValue["message"].empty())
{
// Received by IP connection
sub.type = TransactionRecord::RecvFromIP;
if (!mapValue["from"].empty())
sub.address = mapValue["from"];
}
else
{
bool foundAddress = false;
// Received by Bitcoin Address
sub.type = TransactionRecord::RecvWithAddress;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
if(wallet->IsMine(txout))
@@ -82,11 +75,19 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, wallet, address))
{
sub.type = TransactionRecord::RecvWithAddress;
sub.address = address.ToString();
foundAddress = true;
break;
}
break;
}
}
if(!foundAddress)
{
// Received by IP connection, or other non-address transaction like OP_EVAL
sub.type = TransactionRecord::RecvFromOther;
sub.address = mapValue["from"];
}
}
parts.append(sub);
}
@@ -127,21 +128,19 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
// from a transaction sent back to our own address.
continue;
}
else if(!mapValue["to"].empty())
{
// Sent to IP
sub.type = TransactionRecord::SendToIP;
sub.address = mapValue["to"];
}
else
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, 0, address))
{
// Sent to Bitcoin Address
sub.type = TransactionRecord::SendToAddress;
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, 0, address))
{
sub.address = address.ToString();
}
sub.address = address.ToString();
}
else
{
// Sent to IP, or other non-address transaction like OP_EVAL
sub.type = TransactionRecord::SendToOther;
sub.address = mapValue["to"];
}
int64 nValue = txout.nValue;

View File

@@ -65,9 +65,9 @@ public:
Other,
Generated,
SendToAddress,
SendToIP,
SendToOther,
RecvWithAddress,
RecvFromIP,
RecvFromOther,
SendToSelf
};

View File

@@ -345,12 +345,11 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
{
case TransactionRecord::RecvWithAddress:
return tr("Received with");
case TransactionRecord::RecvFromIP:
return tr("Received from IP");
case TransactionRecord::RecvFromOther:
return tr("Received from");
case TransactionRecord::SendToAddress:
case TransactionRecord::SendToOther:
return tr("Sent to");
case TransactionRecord::SendToIP:
return tr("Sent to IP");
case TransactionRecord::SendToSelf:
return tr("Payment to yourself");
case TransactionRecord::Generated:
@@ -367,10 +366,10 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx
case TransactionRecord::Generated:
return QIcon(":/icons/tx_mined");
case TransactionRecord::RecvWithAddress:
case TransactionRecord::RecvFromIP:
case TransactionRecord::RecvFromOther:
return QIcon(":/icons/tx_input");
case TransactionRecord::SendToAddress:
case TransactionRecord::SendToIP:
case TransactionRecord::SendToOther:
return QIcon(":/icons/tx_output");
default:
return QIcon(":/icons/tx_inout");
@@ -382,12 +381,12 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
{
switch(wtx->type)
{
case TransactionRecord::RecvFromIP:
case TransactionRecord::RecvFromOther:
return QString::fromStdString(wtx->address);
case TransactionRecord::RecvWithAddress:
case TransactionRecord::SendToAddress:
return lookupAddress(wtx->address, tooltip);
case TransactionRecord::SendToIP:
case TransactionRecord::SendToOther:
return QString::fromStdString(wtx->address);
case TransactionRecord::SendToSelf:
case TransactionRecord::Generated:
@@ -478,7 +477,7 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx)
QString TransactionTableModel::formatTooltip(const TransactionRecord *rec) const
{
QString tooltip = formatTxStatus(rec) + QString("\n") + formatTxType(rec);
if(rec->type==TransactionRecord::RecvFromIP || rec->type==TransactionRecord::SendToIP ||
if(rec->type==TransactionRecord::RecvFromOther || rec->type==TransactionRecord::SendToOther ||
rec->type==TransactionRecord::SendToAddress || rec->type==TransactionRecord::RecvWithAddress)
{
tooltip += QString(" ") + formatTxToAddress(rec, true);

View File

@@ -70,9 +70,9 @@ TransactionView::TransactionView(QWidget *parent) :
typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromIP));
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToIP));
TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));

View File

@@ -60,7 +60,7 @@ class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;
static const int VERSION = 50100;
static const int VERSION = 50200;
static const char* pszSubVer = "";
static const bool VERSION_IS_BETA = true;
@@ -829,6 +829,38 @@ struct secure_allocator : public std::allocator<T>
};
//
// Allocator that clears its contents before deletion.
//
template<typename T>
struct zero_after_free_allocator : public std::allocator<T>
{
// MSVC8 default copy constructor is broken
typedef std::allocator<T> base;
typedef typename base::size_type size_type;
typedef typename base::difference_type difference_type;
typedef typename base::pointer pointer;
typedef typename base::const_pointer const_pointer;
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::value_type value_type;
zero_after_free_allocator() throw() {}
zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) {}
template <typename U>
zero_after_free_allocator(const zero_after_free_allocator<U>& a) throw() : base(a) {}
~zero_after_free_allocator() throw() {}
template<typename _Other> struct rebind
{ typedef zero_after_free_allocator<_Other> other; };
void deallocate(T* p, std::size_t n)
{
if (p != NULL)
memset(p, 0, sizeof(T) * n);
std::allocator<T>::deallocate(p, n);
}
};
//
// Double ended buffer combining vector and stream-like interfaces.
@@ -838,7 +870,7 @@ struct secure_allocator : public std::allocator<T>
class CDataStream
{
protected:
typedef std::vector<char, secure_allocator<char> > vector_type;
typedef std::vector<char, zero_after_free_allocator<char> > vector_type;
vector_type vch;
unsigned int nReadPos;
short state;

View File

@@ -469,6 +469,23 @@ void ParseParameters(int argc, char* argv[])
}
}
bool SoftSetArg(const std::string& strArg, const std::string& strValue)
{
if (mapArgs.count(strArg))
return false;
mapArgs[strArg] = strValue;
return true;
}
bool SoftSetArg(const std::string& strArg, bool fValue)
{
if (fValue)
return SoftSetArg(strArg, std::string("1"));
else
return SoftSetArg(strArg, std::string("0"));
}
string EncodeBase64(const unsigned char* pch, size_t len)
{
static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

View File

@@ -292,6 +292,10 @@ public:
// This is exactly like std::string, but with a custom allocator.
// (secure_allocator<> is defined in serialize.h)
typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;
// This is exactly like std::string, but with a custom allocator.
// (secure_allocator<> is defined in serialize.h)
typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;
@@ -455,7 +459,7 @@ inline int64 GetArg(const std::string& strArg, int64 nDefault)
return nDefault;
}
inline bool GetBoolArg(const std::string& strArg)
inline bool GetBoolArg(const std::string& strArg, bool fDefault=false)
{
if (mapArgs.count(strArg))
{
@@ -463,9 +467,26 @@ inline bool GetBoolArg(const std::string& strArg)
return true;
return (atoi(mapArgs[strArg]) != 0);
}
return false;
return fDefault;
}
/**
* Set an argument if it doesn't already have a value
*
* @param strArg Argument to set (e.g. "-foo")
* @param strValue Value (e.g. "1")
* @return true if argument gets set, false if it already had a value
*/
bool SoftSetArg(const std::string& strArg, const std::string& strValue);
/**
* Set a boolean argument if it doesn't already have a value
*
* @param strArg Argument to set (e.g. "-foo")
* @param fValue Value (e.g. false)
* @return true if argument gets set, false if it already had a value
*/
bool SoftSetArg(const std::string& strArg, bool fValue);