mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-17 10:59:27 +00:00
Merge branch '0.5.0.x' into 0.5.x
Conflicts: bitcoin-qt.pro doc/README doc/README_windows.txt share/setup.nsi src/serialize.h
This commit is contained in:
commit
815a3605c1
@ -254,6 +254,7 @@ isEmpty(BOOST_INCLUDE_PATH) {
|
||||
windows:LIBS += -lmingwthrd -lws2_32
|
||||
windows:DEFINES += _MT WIN32
|
||||
windows:RC_FILE = src/qt/res/bitcoin-qt.rc
|
||||
windows:QMAKE_LIBS_QT_ENTRY -= -lmingw32
|
||||
|
||||
macx:HEADERS += src/qt/macdockiconhandler.h
|
||||
macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm
|
||||
|
||||
@ -47,7 +47,6 @@ script: |
|
||||
cp -a bin $SRCDIR/
|
||||
cd $INSTDIR
|
||||
find . -name *.prl | xargs -l sed 's|/$||' -i
|
||||
sed 's/QMAKE_LIBS_QT_ENTRY = -lmingw32 -lqtmain/QMAKE_LIBS_QT_ENTRY = -lqtmain/' -i mkspecs/unsupported/win32-g++-cross/qmake.conf
|
||||
#sed 's|QMAKE_PRL_LIBS.*|QMAKE_PRL_LIBS = -lQtDeclarative -lQtScript -lQtSvg -lQtSql -lQtXmlPatterns -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtNetwork -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32|' -i imports/Qt/labs/particles/qmlparticlesplugin.prl
|
||||
|
||||
# as zip stores file timestamps, use faketime to intercept stat calls to set dates for all files to reference date
|
||||
|
||||
@ -243,7 +243,7 @@ public:
|
||||
std::vector<unsigned char> getvch() const
|
||||
{
|
||||
unsigned int nSize = BN_bn2mpi(this, NULL);
|
||||
if (nSize < 4)
|
||||
if (nSize <= 4)
|
||||
return std::vector<unsigned char>();
|
||||
std::vector<unsigned char> vch(nSize);
|
||||
BN_bn2mpi(this, &vch[0]);
|
||||
|
||||
35
src/db.cpp
35
src/db.cpp
@ -780,7 +780,10 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
// Get cursor
|
||||
Dbc* pcursor = GetCursor();
|
||||
if (!pcursor)
|
||||
{
|
||||
printf("Error getting wallet database cursor\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
|
||||
loop
|
||||
{
|
||||
@ -791,7 +794,10 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
if (ret == DB_NOTFOUND)
|
||||
break;
|
||||
else if (ret != 0)
|
||||
{
|
||||
printf("Error reading next record from wallet database\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
|
||||
// Unserialize
|
||||
// Taking advantage of the fact that pair serialization
|
||||
@ -861,19 +867,38 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
CPrivKey pkey;
|
||||
ssValue >> pkey;
|
||||
key.SetPrivKey(pkey);
|
||||
if (key.GetPubKey() != vchPubKey || !key.IsValid())
|
||||
if (key.GetPubKey() != vchPubKey)
|
||||
{
|
||||
printf("Error reading wallet database: CPrivKey pubkey inconsistency\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
if (!key.IsValid())
|
||||
{
|
||||
printf("Error reading wallet database: invalid CPrivKey\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CWalletKey wkey;
|
||||
ssValue >> wkey;
|
||||
key.SetPrivKey(wkey.vchPrivKey);
|
||||
if (key.GetPubKey() != vchPubKey || !key.IsValid())
|
||||
if (key.GetPubKey() != vchPubKey)
|
||||
{
|
||||
printf("Error reading wallet database: CWalletKey pubkey inconsistency\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
if (!key.IsValid())
|
||||
{
|
||||
printf("Error reading wallet database: invalid CWalletKey\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
}
|
||||
if (!pwallet->LoadKey(key))
|
||||
{
|
||||
printf("Error reading wallet database: LoadKey failed\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
}
|
||||
else if (strType == "mkey")
|
||||
{
|
||||
@ -882,7 +907,10 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
CMasterKey kMasterKey;
|
||||
ssValue >> kMasterKey;
|
||||
if(pwallet->mapMasterKeys.count(nID) != 0)
|
||||
{
|
||||
printf("Error reading wallet database: duplicate CMasterKey id %u\n", nID);
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
pwallet->mapMasterKeys[nID] = kMasterKey;
|
||||
if (pwallet->nMasterKeyMaxID < nID)
|
||||
pwallet->nMasterKeyMaxID = nID;
|
||||
@ -894,7 +922,10 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
|
||||
vector<unsigned char> vchPrivKey;
|
||||
ssValue >> vchPrivKey;
|
||||
if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey))
|
||||
{
|
||||
printf("Error reading wallet database: LoadCryptedKey failed\n");
|
||||
return DB_CORRUPT;
|
||||
}
|
||||
fIsEncrypted = true;
|
||||
}
|
||||
else if (strType == "defaultkey")
|
||||
|
||||
@ -370,12 +370,14 @@ bool AppInit2(int argc, char* argv[])
|
||||
else if (nLoadWalletRet == DB_NEED_REWRITE)
|
||||
{
|
||||
strErrors += _("Wallet needed to be rewritten: restart Bitcoin to complete \n");
|
||||
printf("%s", strErrors.c_str());
|
||||
wxMessageBox(strErrors, "Bitcoin", wxOK | wxICON_ERROR);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
strErrors += _("Error loading wallet.dat \n");
|
||||
}
|
||||
printf("%s", strErrors.c_str());
|
||||
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
|
||||
|
||||
RegisterWallet(pwalletMain);
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
#include <QStackedWidget>
|
||||
#include <QDateTime>
|
||||
#include <QMovie>
|
||||
#include <QTimer>
|
||||
|
||||
#include <QDragEnterEvent>
|
||||
#include <QUrl>
|
||||
@ -55,7 +56,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
|
||||
QMainWindow(parent),
|
||||
clientModel(0),
|
||||
walletModel(0),
|
||||
dummyWidget(0),
|
||||
encryptWalletAction(0),
|
||||
changePassphraseAction(0),
|
||||
aboutQtAction(0),
|
||||
@ -85,9 +85,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
|
||||
// Create the tray icon (or setup the dock icon)
|
||||
createTrayIcon();
|
||||
|
||||
// Dummy widget used when restoring window state after minimization
|
||||
dummyWidget = new QWidget();
|
||||
|
||||
// Create tabs
|
||||
overviewPage = new OverviewPage();
|
||||
|
||||
@ -161,7 +158,6 @@ BitcoinGUI::~BitcoinGUI()
|
||||
#ifdef Q_WS_MAC
|
||||
delete appMenuBar;
|
||||
#endif
|
||||
delete dummyWidget;
|
||||
}
|
||||
|
||||
void BitcoinGUI::createActions()
|
||||
@ -387,14 +383,6 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
|
||||
}
|
||||
#endif
|
||||
|
||||
void BitcoinGUI::showNormal()
|
||||
{
|
||||
// Reparent window to the desktop (in case it was hidden on minimize)
|
||||
if(parent() != NULL)
|
||||
setParent(NULL, Qt::Window);
|
||||
QMainWindow::showNormal();
|
||||
}
|
||||
|
||||
void BitcoinGUI::optionsClicked()
|
||||
{
|
||||
if(!clientModel || !clientModel->getOptionsModel())
|
||||
@ -536,25 +524,21 @@ void BitcoinGUI::error(const QString &title, const QString &message)
|
||||
|
||||
void BitcoinGUI::changeEvent(QEvent *e)
|
||||
{
|
||||
QMainWindow::changeEvent(e);
|
||||
#ifndef Q_WS_MAC // Ignored on Mac
|
||||
if(e->type() == QEvent::WindowStateChange)
|
||||
{
|
||||
if(clientModel && clientModel->getOptionsModel()->getMinimizeToTray())
|
||||
{
|
||||
if(isMinimized())
|
||||
QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);
|
||||
if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())
|
||||
{
|
||||
// Hiding the window from taskbar
|
||||
setParent(dummyWidget, Qt::SubWindow);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
showNormal();
|
||||
QTimer::singleShot(0, this, SLOT(hide()));
|
||||
e->ignore();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
QMainWindow::changeEvent(e);
|
||||
}
|
||||
|
||||
void BitcoinGUI::closeEvent(QCloseEvent *event)
|
||||
|
||||
@ -57,8 +57,6 @@ private:
|
||||
|
||||
QStackedWidget *centralWidget;
|
||||
|
||||
QWidget *dummyWidget;
|
||||
|
||||
OverviewPage *overviewPage;
|
||||
QWidget *transactionsPage;
|
||||
AddressBookPage *addressBookPage;
|
||||
@ -126,8 +124,6 @@ public slots:
|
||||
*/
|
||||
void askFee(qint64 nFeeRequired, bool *payFee);
|
||||
|
||||
void showNormal();
|
||||
|
||||
private slots:
|
||||
/** Switch to overview (home) page */
|
||||
void gotoOverviewPage();
|
||||
|
||||
@ -66,6 +66,7 @@ void SendCoinsEntry::on_payTo_textChanged(const QString &address)
|
||||
void SendCoinsEntry::setModel(WalletModel *model)
|
||||
{
|
||||
this->model = model;
|
||||
clear();
|
||||
}
|
||||
|
||||
void SendCoinsEntry::setRemoveEnabled(bool enabled)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user