v29.4-roots.4 · Commit 18: [PATCH 18/37] test(qt): lock wallet transaction assertions
src/qt/test/wallettests.cpp
Before: src/qt/test/wallettests.cpp · After: src/qt/test/wallettests.cpp
File metadata
index 8e7031719c052206667b9ea99d45f6485f9094cd..48cc4b7e7a2e3e34dea3be08f14b78dd7ac5f01c 100644
Download original patch · Release notes
Diff rows 1–24 of 24. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/qt/test/wallettests.cpp
CHANGED
|
@@ -305,8 +305,11 @@ void TestGUI(interfaces::Node& node, const std::shared_ptr<CWallet>& wallet)
|
|
|
305
305
|
uint256 txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, /*rbf=*/false, QMessageBox::Yes, &no_rbf_confirmation);
|
|
306
306
|
QString rbf_confirmation;
|
|
307
307
|
uint256 txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN, /*rbf=*/true, QMessageBox::Yes, &rbf_confirmation);
|
|
308
|
-
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid1).tx));
|
|
309
|
-
QVERIFY(SignalsOptInRBF(*wallet->mapWallet.at(txid2).tx));
|
|
308
|
+
{
|
|
309
|
+
LOCK(wallet->cs_wallet);
|
|
310
|
+
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid1).tx));
|
|
311
|
+
QVERIFY(SignalsOptInRBF(*wallet->mapWallet.at(txid2).tx));
|
|
312
|
+
}
|
|
310
313
|
QVERIFY(no_rbf_confirmation.contains("Not signalling Replace-By-Fee, BIP-125."));
|
|
311
314
|
QVERIFY(rbf_confirmation.contains("signals Replace-By-Fee (BIP-125)"));
|
|
312
315
|
|
|
@@ -316,7 +319,10 @@ void TestGUI(interfaces::Node& node, const std::shared_ptr<CWallet>& wallet)
|
|
|
316
319
|
QVERIFY(default_rbf_dialog.findChild<QCheckBox*>("optInRBF")->isChecked());
|
|
317
320
|
QString default_on_override_confirmation;
|
|
318
321
|
uint256 txid3 = SendCoins(*wallet.get(), default_rbf_dialog, PKHash(), COIN, /*rbf=*/false, QMessageBox::Yes, &default_on_override_confirmation);
|
|
319
|
-
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid3).tx));
|
|
322
|
+
{
|
|
323
|
+
LOCK(wallet->cs_wallet);
|
|
324
|
+
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid3).tx));
|
|
325
|
+
}
|
|
320
326
|
QVERIFY(default_on_override_confirmation.contains("Not signalling Replace-By-Fee, BIP-125."));
|
|
321
327
|
// Transaction table model updates on a QueuedConnection, so process events to ensure it's updated.
|
|
322
328
|
qApp->processEvents();
|