aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/makefile.unix2
-rw-r--r--src/qt/clientmodel.cpp5
-rw-r--r--src/wallet.cpp2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/makefile.unix b/src/makefile.unix
index 14cf1b8fa5..b52a0f8aea 100644
--- a/src/makefile.unix
+++ b/src/makefile.unix
@@ -7,7 +7,7 @@ USE_IPV6:=1
LINK:=$(CXX)
-DEFS=-DBOOST_SPIRIT_THREADSAFE
+DEFS=-DBOOST_SPIRIT_THREADSAFE -D_FILE_OFFSET_BITS=64
DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/obj $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index 12bd989338..084ad12a56 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -48,7 +48,10 @@ int ClientModel::getNumBlocksAtStartup()
QDateTime ClientModel::getLastBlockDate() const
{
- return QDateTime::fromTime_t(pindexBest->GetBlockTime());
+ if (pindexBest)
+ return QDateTime::fromTime_t(pindexBest->GetBlockTime());
+ else
+ return QDateTime::fromTime_t(1231006505); // Genesis block's time
}
void ClientModel::updateTimer()
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 557784e5c2..b8ef2a20bf 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -1190,7 +1190,7 @@ bool CWallet::CreateTransaction(const vector<pair<CScript, int64> >& vecSend, CW
scriptChange.SetDestination(vchPubKey.GetID());
// Insert change txn at random position:
- vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size());
+ vector<CTxOut>::iterator position = wtxNew.vout.begin()+GetRandInt(wtxNew.vout.size()+1);
wtxNew.vout.insert(position, CTxOut(nChange, scriptChange));
}
else