aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/chainparams.cpp1
-rw-r--r--src/qt/walletmodel.cpp18
-rw-r--r--src/qt/walletmodel.h1
-rw-r--r--src/walletdb.cpp9
4 files changed, 20 insertions, 9 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index bfe50d77d5..460fabc6e6 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -155,6 +155,7 @@ public:
vSeeds.push_back(CDNSSeedData("alexykot.me", "testnet-seed.alexykot.me"));
vSeeds.push_back(CDNSSeedData("bitcoin.petertodd.org", "testnet-seed.bitcoin.petertodd.org"));
vSeeds.push_back(CDNSSeedData("bluematt.me", "testnet-seed.bluematt.me"));
+ vSeeds.push_back(CDNSSeedData("bitcoin.schildbach.de", "testnet-seed.bitcoin.schildbach.de"));
base58Prefixes[PUBKEY_ADDRESS] = list_of(111);
base58Prefixes[SCRIPT_ADDRESS] = list_of(196);
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 92c22f5692..530c46cdb4 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -36,6 +36,7 @@ WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *p
{
fProcessingQueuedTransactions = false;
fHaveWatchOnly = wallet->HaveWatchOnly();
+ fForceCheckBalanceChanged = false;
addressTableModel = new AddressTableModel(wallet, this);
transactionTableModel = new TransactionTableModel(wallet, this);
@@ -121,8 +122,10 @@ void WalletModel::pollBalanceChanged()
if(!lockWallet)
return;
- if(chainActive.Height() != cachedNumBlocks)
+ if(fForceCheckBalanceChanged || chainActive.Height() != cachedNumBlocks)
{
+ fForceCheckBalanceChanged = false;
+
// Balance and number of transactions might have changed
cachedNumBlocks = chainActive.Height();
@@ -167,7 +170,7 @@ void WalletModel::updateTransaction(const QString &hash, int status)
transactionTableModel->updateTransaction(hash, status);
// Balance and number of transactions might have changed
- checkBalanceChanged();
+ fForceCheckBalanceChanged = true;
}
void WalletModel::updateAddressBook(const QString &address, const QString &label,
@@ -344,6 +347,7 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &tran
}
emit coinsSent(wallet, rcp, transaction_array);
}
+ checkBalanceChanged(); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits
return SendCoinsReturn(OK);
}
@@ -473,11 +477,6 @@ static void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet,
static void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress)
{
- // emits signal "showProgress"
- QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection,
- Q_ARG(QString, QString::fromStdString(title)),
- Q_ARG(int, nProgress));
-
if (nProgress == 0)
fQueueNotifications = true;
@@ -495,6 +494,11 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int
}
std::vector<std::pair<uint256, ChangeType> >().swap(vQueueNotifications); // clear
}
+
+ // emits signal "showProgress"
+ QMetaObject::invokeMethod(walletmodel, "showProgress", Qt::QueuedConnection,
+ Q_ARG(QString, QString::fromStdString(title)),
+ Q_ARG(int, nProgress));
}
static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly)
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 00a011d937..111ae2178c 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -199,6 +199,7 @@ private:
CWallet *wallet;
bool fProcessingQueuedTransactions;
bool fHaveWatchOnly;
+ bool fForceCheckBalanceChanged;
// Wallet has an options model for wallet-specific options
// (transaction fee, for example)
diff --git a/src/walletdb.cpp b/src/walletdb.cpp
index 2fa6071658..48045b98c8 100644
--- a/src/walletdb.cpp
+++ b/src/walletdb.cpp
@@ -281,8 +281,12 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
nOrderPos = nOrderPosNext++;
nOrderPosOffsets.push_back(nOrderPos);
- if (pacentry)
- // Have to write accounting regardless, since we don't keep it in memory
+ if (pwtx)
+ {
+ if (!WriteTx(pwtx->GetHash(), *pwtx))
+ return DB_LOAD_FAIL;
+ }
+ else
if (!WriteAccountingEntry(pacentry->nEntryNo, *pacentry))
return DB_LOAD_FAIL;
}
@@ -311,6 +315,7 @@ CWalletDB::ReorderTransactions(CWallet* pwallet)
return DB_LOAD_FAIL;
}
}
+ WriteOrderPosNext(nOrderPosNext);
return DB_LOAD_OK;
}