v30.3-roots.1 · Commit 18: [PATCH 18/68] 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 a477110f9ae62f0d0b236850d143289323e9ba75..c9a65d995bc015a858927d6b205b15d0caf518d2 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
|
@@ -297,8 +297,11 @@ void TestGUI(interfaces::Node& node, const std::shared_ptr<CWallet>& wallet)
|
|
|
297
297
|
Txid txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, /*rbf=*/false, QMessageBox::Yes, &no_rbf_confirmation);
|
|
298
298
|
QString rbf_confirmation;
|
|
299
299
|
Txid txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN, /*rbf=*/true, QMessageBox::Yes, &rbf_confirmation);
|
|
300
|
-
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid1).tx));
|
|
301
|
-
QVERIFY(SignalsOptInRBF(*wallet->mapWallet.at(txid2).tx));
|
|
300
|
+
{
|
|
301
|
+
LOCK(wallet->cs_wallet);
|
|
302
|
+
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid1).tx));
|
|
303
|
+
QVERIFY(SignalsOptInRBF(*wallet->mapWallet.at(txid2).tx));
|
|
304
|
+
}
|
|
302
305
|
QVERIFY(no_rbf_confirmation.contains("Not signalling Replace-By-Fee, BIP-125."));
|
|
303
306
|
QVERIFY(rbf_confirmation.contains("signals Replace-By-Fee (BIP-125)"));
|
|
304
307
|
|
|
@@ -308,7 +311,10 @@ void TestGUI(interfaces::Node& node, const std::shared_ptr<CWallet>& wallet)
|
|
|
308
311
|
QVERIFY(default_rbf_dialog.findChild<QCheckBox*>("optInRBF")->isChecked());
|
|
309
312
|
QString default_on_override_confirmation;
|
|
310
313
|
Txid txid3 = SendCoins(*wallet.get(), default_rbf_dialog, PKHash(), COIN, /*rbf=*/false, QMessageBox::Yes, &default_on_override_confirmation);
|
|
311
|
-
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid3).tx));
|
|
314
|
+
{
|
|
315
|
+
LOCK(wallet->cs_wallet);
|
|
316
|
+
QVERIFY(!SignalsOptInRBF(*wallet->mapWallet.at(txid3).tx));
|
|
317
|
+
}
|
|
312
318
|
QVERIFY(default_on_override_confirmation.contains("Not signalling Replace-By-Fee, BIP-125."));
|
|
313
319
|
// Transaction table model updates on a QueuedConnection, so process events to ensure it's updated.
|
|
314
320
|
qApp->processEvents();
|