mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-22 00:00:55 +01:00
Compare commits
74 Commits
v0.21.0rc2
...
v0.5.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7de7913abd | ||
|
|
780a182317 | ||
|
|
99e9601e80 | ||
|
|
45099b19da | ||
|
|
a2e9767225 | ||
|
|
20e3f2aefc | ||
|
|
fb88f1cc97 | ||
|
|
eb2a10afd6 | ||
|
|
cc6bd19660 | ||
|
|
84393f15b6 | ||
|
|
b52b6f2e38 | ||
|
|
a91a40febd | ||
|
|
3b8051864b | ||
|
|
961cf14ab3 | ||
|
|
8632383161 | ||
|
|
ab4b52a239 | ||
|
|
96f1723bb1 | ||
|
|
027d149352 | ||
|
|
96c700f5e4 | ||
|
|
f503a1486a | ||
|
|
987f26aa1a | ||
|
|
6be2c9b5b4 | ||
|
|
7aa253d3ec | ||
|
|
9ea0699278 | ||
|
|
f1a6d74775 | ||
|
|
5fe2dbd7b6 | ||
|
|
ace5ce05be | ||
|
|
98c0b8b85e | ||
|
|
1f53204045 | ||
|
|
181b863d22 | ||
|
|
142e5056cd | ||
|
|
9a7f4948c6 | ||
|
|
12c69167e3 | ||
|
|
b379bc5eef | ||
|
|
16e7c05de7 | ||
|
|
4c519a47a9 | ||
|
|
ba56a88ca5 | ||
|
|
fe5cc3b7f8 | ||
|
|
5d901f1ba0 | ||
|
|
0e6425da4a | ||
|
|
f8c3eb9568 | ||
|
|
d27be1f557 | ||
|
|
3741185a51 | ||
|
|
cba18514c0 | ||
|
|
a7d735dcc2 | ||
|
|
094c35cffc | ||
|
|
b683118cd0 | ||
|
|
1c4be55a99 | ||
|
|
7597fcd92f | ||
|
|
adb9f7ddde | ||
|
|
99fe0af2fe | ||
|
|
45593c271a | ||
|
|
d885aba347 | ||
|
|
36b1eb7631 | ||
|
|
76ef6d89b9 | ||
|
|
c4a3bf9e55 | ||
|
|
90de05e88e | ||
|
|
2bf36b4e7d | ||
|
|
831d24a19d | ||
|
|
1aafd7464f | ||
|
|
586ea168c2 | ||
|
|
1179f6373d | ||
|
|
0143c024af | ||
|
|
2744ea8c1f | ||
|
|
00eae584a2 | ||
|
|
ef4280e08b | ||
|
|
ed176ba584 | ||
|
|
38a976d5bb | ||
|
|
b526cbaa71 | ||
|
|
aec5c5fe26 | ||
|
|
600dc62559 | ||
|
|
030d7acf7d | ||
|
|
20cff2ade4 | ||
|
|
7944d81567 |
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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 ..
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}"
|
||||
|
||||
67
src/init.cpp
67
src/init.cpp
@@ -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
|
||||
//
|
||||
|
||||
17
src/irc.cpp
17
src/irc.cpp
@@ -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;
|
||||
|
||||
11
src/main.cpp
11
src/main.cpp
@@ -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
|
||||
|
||||
65
src/net.cpp
65
src/net.cpp
@@ -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
|
||||
|
||||
@@ -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/>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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'indirizzo dalla rubrica</translation>
|
||||
</message>
|
||||
<message>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"/>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -65,9 +65,9 @@ public:
|
||||
Other,
|
||||
Generated,
|
||||
SendToAddress,
|
||||
SendToIP,
|
||||
SendToOther,
|
||||
RecvWithAddress,
|
||||
RecvFromIP,
|
||||
RecvFromOther,
|
||||
SendToSelf
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
17
src/util.cpp
17
src/util.cpp
@@ -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+/";
|
||||
|
||||
25
src/util.h
25
src/util.h
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user