Conflicts:
	.gitignore
This commit is contained in:
Wladimir J. van der Laan 2011-09-07 18:57:11 +02:00
commit a0d2f9a12d
10 changed files with 1150 additions and 38 deletions

6
.gitignore vendored
View file

@ -3,6 +3,12 @@ src/bitcoin
src/bitcoind src/bitcoind
.*.swp .*.swp
*.*~* *.*~*
*.bak
*.rej
*.orig
*.o
*.patch
.bitcoin
#compilation and Qt preprocessor part #compilation and Qt preprocessor part
*.o *.o
ui_*.h ui_*.h

View file

@ -1,16 +1,30 @@
Bitcoin integration/staging tree Bitcoin integration/staging tree
Development process Development process
=================== ===================
Developers work in their own trees, then submit pull requests when they think their feature or bug fix is ready. Developers work in their own trees, then submit pull requests when
they think their feature or bug fix is ready.
If it is a simple/trivial/non-controversial change, then one of the bitcoin development team members simply pulls it. If it is a simple/trivial/non-controversial change, then one of the
bitcoin development team members simply pulls it.
If it is a more complicated or potentially controversial change, then the patch submitter will be asked to start a discussion (if they haven't already) on the development forums: http://www.bitcoin.org/smf/index.php?board=6.0 If it is a more complicated or potentially controversial
The patch will be accepted if there is broad consensus that it is a good thing. Developers should expect to rework and resubmit patches if they don't match the project's coding conventions (see coding.txt) or are controversial. change, then the patch submitter will be asked to start a
discussion (if they haven't already) on the mailing list:
http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development
The master branch is regularly built and tested (by who? need people willing to be quality assurance testers), and periodically pushed to the subversion repo to become the official, stable, released bitcoin. The patch will be accepted if there is broad consensus that it is a
good thing. Developers should expect to rework and resubmit patches
if they don't match the project's coding conventions (see coding.txt)
or are controversial.
The master branch is regularly built and tested, but is not guaranteed
to be completely stable. Tags are regularly created to indicate new
official, stable release versions of Bitcoin. If you would like to
help test the Bitcoin core, please contact QA@Bitcoin.org.
Feature branches are created when there are major new features being
worked on by several people.
Feature branches are created when there are major new features being worked on by several people.

View file

@ -18,7 +18,8 @@ remotes:
- "url": "https://github.com/bitcoin/bitcoin.git" - "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin" "dir": "bitcoin"
files: files:
- "wxWidgets-2.9.2-gitian.zip" - "wxWidgets-2.9.2-x64-gitian.zip"
- "wxWidgets-2.9.2-x32-gitian.zip"
- "miniupnpc-1.6.tar.gz" - "miniupnpc-1.6.tar.gz"
script: | script: |
INSTDIR="$HOME/install" INSTDIR="$HOME/install"
@ -32,7 +33,8 @@ script: |
mkdir -p $INSTDIR/bin $INSTDIR/lib/wx $INSTDIR/include mkdir -p $INSTDIR/bin $INSTDIR/lib/wx $INSTDIR/include
mkdir wxWidgets-2.9.2 mkdir wxWidgets-2.9.2
cd wxWidgets-2.9.2 cd wxWidgets-2.9.2
unzip ../wxWidgets-2.9.2-gitian.zip unzip ../wxWidgets-2.9.2-x32-gitian.zip
unzip -f ../wxWidgets-2.9.2-x64-gitian.zip
cp -a bin/$GBUILD_BITS/wx/config/gtk2-unicode-static-2.9 $INSTDIR/bin/wx-config cp -a bin/$GBUILD_BITS/wx/config/gtk2-unicode-static-2.9 $INSTDIR/bin/wx-config
for lib in wx_gtk2u wxregexu wxtiff; do for lib in wx_gtk2u wxregexu wxtiff; do
ar rc $INSTDIR/lib/lib${lib}-2.9.a bin/$GBUILD_BITS/$lib/*.o ar rc $INSTDIR/lib/lib${lib}-2.9.a bin/$GBUILD_BITS/$lib/*.o

View file

@ -38,5 +38,5 @@ script: |
cd $TMPDIR cd $TMPDIR
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME export FAKETIME=$REFERENCE_DATETIME
zip -r wxWidgets-2.9.2-gitian.zip * zip -r wxWidgets-2.9.2-x$GBUILD_BITS-gitian.zip *
cp wxWidgets-2.9.2-gitian.zip $OUTDIR cp wxWidgets-2.9.2-x$GBUILD_BITS-gitian.zip $OUTDIR

View file

@ -3,3 +3,5 @@ locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
.po is the sourcefile .po is the sourcefile
.mo is the compiled translation .mo is the compiled translation
Note: pull requests should only include the .po file. Do not include .mo file

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -820,7 +820,7 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
// Read txindex // Read txindex
CTxIndex txindex; CTxIndex txindex;
bool fFound = true; bool fFound = true;
if (fMiner && mapTestPool.count(prevout.hash)) if ((fBlock || fMiner) && mapTestPool.count(prevout.hash))
{ {
// Get txindex from current proposed changes // Get txindex from current proposed changes
txindex = mapTestPool[prevout.hash]; txindex = mapTestPool[prevout.hash];
@ -880,12 +880,7 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
txindex.vSpent[prevout.n] = posThisTx; txindex.vSpent[prevout.n] = posThisTx;
// Write back // Write back
if (fBlock) if (fBlock || fMiner)
{
if (!txdb.UpdateTxIndex(prevout.hash, txindex))
return error("ConnectInputs() : UpdateTxIndex failed");
}
else if (fMiner)
{ {
mapTestPool[prevout.hash] = txindex; mapTestPool[prevout.hash] = txindex;
} }
@ -907,9 +902,8 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
if (fBlock) if (fBlock)
{ {
// Add transaction to disk index // Add transaction to changes
if (!txdb.AddTxIndex(*this, posThisTx, pindexBlock->nHeight)) mapTestPool[GetHash()] = CTxIndex(posThisTx, vout.size());
return error("ConnectInputs() : AddTxPos failed");
} }
else if (fMiner) else if (fMiner)
{ {
@ -998,16 +992,22 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
//// issue here: it doesn't know the version //// issue here: it doesn't know the version
unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK) - 1 + GetSizeOfCompactSize(vtx.size()); unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK) - 1 + GetSizeOfCompactSize(vtx.size());
map<uint256, CTxIndex> mapUnused; map<uint256, CTxIndex> mapQueuedChanges;
int64 nFees = 0; int64 nFees = 0;
BOOST_FOREACH(CTransaction& tx, vtx) BOOST_FOREACH(CTransaction& tx, vtx)
{ {
CDiskTxPos posThisTx(pindex->nFile, pindex->nBlockPos, nTxPos); CDiskTxPos posThisTx(pindex->nFile, pindex->nBlockPos, nTxPos);
nTxPos += ::GetSerializeSize(tx, SER_DISK); nTxPos += ::GetSerializeSize(tx, SER_DISK);
if (!tx.ConnectInputs(txdb, mapUnused, posThisTx, pindex, nFees, true, false)) if (!tx.ConnectInputs(txdb, mapQueuedChanges, posThisTx, pindex, nFees, true, false))
return false; return false;
} }
// Write queued txindex changes
for (map<uint256, CTxIndex>::iterator mi = mapQueuedChanges.begin(); mi != mapQueuedChanges.end(); ++mi)
{
if (!txdb.UpdateTxIndex((*mi).first, (*mi).second))
return error("ConnectBlock() : UpdateTxIndex failed");
}
if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees)) if (vtx[0].GetValueOut() > GetBlockValue(pindex->nHeight, nFees))
return false; return false;

View file

@ -443,6 +443,10 @@ bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
if (addr.ip == addrLocalHost.ip) if (addr.ip == addrLocalHost.ip)
return false; return false;
addr.nTime = max((int64)0, (int64)addr.nTime - nTimePenalty); addr.nTime = max((int64)0, (int64)addr.nTime - nTimePenalty);
bool fUpdated = false;
bool fNew = false;
CAddress addrFound = addr;
CRITICAL_BLOCK(cs_mapAddresses) CRITICAL_BLOCK(cs_mapAddresses)
{ {
map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey()); map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey());
@ -451,16 +455,12 @@ bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
// New address // New address
printf("AddAddress(%s)\n", addr.ToString().c_str()); printf("AddAddress(%s)\n", addr.ToString().c_str());
mapAddresses.insert(make_pair(addr.GetKey(), addr)); mapAddresses.insert(make_pair(addr.GetKey(), addr));
if (pAddrDB) fUpdated = true;
pAddrDB->WriteAddress(addr); fNew = true;
else
CAddrDB().WriteAddress(addr);
return true;
} }
else else
{ {
bool fUpdated = false; addrFound = (*it).second;
CAddress& addrFound = (*it).second;
if ((addrFound.nServices | addr.nServices) != addrFound.nServices) if ((addrFound.nServices | addr.nServices) != addrFound.nServices)
{ {
// Services have been added // Services have been added
@ -475,6 +475,14 @@ bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
addrFound.nTime = addr.nTime; addrFound.nTime = addr.nTime;
fUpdated = true; fUpdated = true;
} }
}
}
// There is a nasty deadlock bug if this is done inside the cs_mapAddresses
// CRITICAL_BLOCK:
// Thread 1: begin db transaction (locks inside-db-mutex)
// then AddAddress (locks cs_mapAddresses)
// Thread 2: AddAddress (locks cs_mapAddresses)
// ... then db operation hangs waiting for inside-db-mutex
if (fUpdated) if (fUpdated)
{ {
if (pAddrDB) if (pAddrDB)
@ -482,9 +490,7 @@ bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
else else
CAddrDB().WriteAddress(addrFound); CAddrDB().WriteAddress(addrFound);
} }
} return fNew;
}
return false;
} }
void AddressCurrentlyConnected(const CAddress& addr) void AddressCurrentlyConnected(const CAddress& addr)

View file

@ -1805,7 +1805,11 @@ void SetStartOnSystemStartup(bool fAutoStart)
{ {
if (!fAutoStart) if (!fAutoStart)
{ {
#if defined(BOOST_FILESYSTEM_VERSION) && BOOST_FILESYSTEM_VERSION >= 3
unlink(GetAutostartFilePath().string().c_str());
#else
unlink(GetAutostartFilePath().native_file_string().c_str()); unlink(GetAutostartFilePath().native_file_string().c_str());
#endif
} }
else else
{ {