Page MenuHomePhabricator

wallet: Fix unique_ptr usage in boost::signals2
ClosedPublic

Authored by deadalnix on Oct 1 2020, 10:38.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCbc81b0e205af: wallet: Fix unique_ptr usage in boost::signals2
Summary
  • Drop signal CClientUIInterface::LoadWallet
  • gui: Fix duplicate wallet showing up

The slot BitcoinGUI::addWallet can be invoked twice for the same
WalletModel due to a concurrent wallet being loaded after the first connect():

cpp
 connect(wallet_controller, &WalletController::walletAdded, this, &BitcoinGUI::addWallet);
 connect(wallet_controller, &WalletController::walletRemoved, this, &BitcoinGUI::removeWallet);

 for (WalletModel* wallet_model : m_wallet_controller->getOpenWallets()) {
     addWallet(wallet_model);

This is a backport of Core PR16963

Because WalletFrame::addWallet already returns a bool, that part of the patch wasn't necessary.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Snippet of first build failure:

[297/482] Building CXX object src/CMakeFiles/util.dir/util/spanparsing.cpp.o
[298/482] Building CXX object src/CMakeFiles/util.dir/util/threadnames.cpp.o
[299/482] Building CXX object src/CMakeFiles/util.dir/sync.cpp.o
[300/482] Building CXX object src/CMakeFiles/util.dir/util/url.cpp.o
[301/482] Building CXX object src/CMakeFiles/util.dir/util/moneystr.cpp.o
[302/482] Building CXX object src/CMakeFiles/script.dir/script/descriptor.cpp.o
[303/482] Building CXX object src/CMakeFiles/util.dir/util/settings.cpp.o
[304/482] Building CXX object src/CMakeFiles/util.dir/util/validation.cpp.o
[305/482] Building CXX object src/CMakeFiles/util.dir/util/strencodings.cpp.o
[306/482] Linking C static library src/secp256k1/libsecp256k1.a
[307/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/arith_uint256.cpp.o
[308/482] Linking C executable src/secp256k1/ecmult-bench
[309/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/uint256.cpp.o
[310/482] Linking C executable src/secp256k1/internal-bench
[311/482] Linking C executable src/secp256k1/sign-bench
[312/482] Linking C executable src/secp256k1/recover-bench
[313/482] Linking C executable src/secp256k1/verify-bench
[314/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/hash.cpp.o
[315/482] Building CXX object src/CMakeFiles/util.dir/rpc/request.cpp.o
[316/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/str.cpp.o
[317/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/util/strencodings.cpp.o
[318/482] Building CXX object src/CMakeFiles/util.dir/util/error.cpp.o
[319/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/primitives/transaction.cpp.o
[320/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/pubkey.cpp.o
[321/482] Building CXX object src/CMakeFiles/bitcoinconsensus.dir/consensus/tx_check.cpp.o
[322/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/logging.cpp.o
[323/482] Building CXX object src/CMakeFiles/server.dir/validation.cpp.o
[324/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/transaction_utils.cpp.o
[325/482] Building CXX object src/CMakeFiles/bitcoin-tx.dir/bitcoin-tx.cpp.o
[326/482] Building CXX object src/CMakeFiles/util.dir/util/time.cpp.o
[327/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/blockfilter.cpp.o
[328/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/coincontrol.cpp.o
[329/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/mining.cpp.o
[330/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/crypter.cpp.o
[331/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/coinselection.cpp.o
[332/482] Building CXX object src/CMakeFiles/util.dir/util/system.cpp.o
[333/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/wallet.cpp.o
[334/482] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqabstractnotifier.cpp.o
[335/482] Building CXX object src/wallet/CMakeFiles/wallet-tool.dir/wallettool.cpp.o
[336/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/db.cpp.o
[337/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/fees.cpp.o
[338/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/load.cpp.o
[339/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletutil.cpp.o
[340/482] Building CXX object src/test/CMakeFiles/testutil.dir/util/setup_common.cpp.o
[341/482] Building CXX object src/seeder/CMakeFiles/seeder.dir/dns.cpp.o
[342/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/psbtwallet.cpp.o
[343/482] Building CXX object src/seeder/CMakeFiles/seeder.dir/bitcoin.cpp.o
[344/482] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqnotificationinterface.cpp.o
[345/482] Building CXX object src/seeder/CMakeFiles/seeder.dir/db.cpp.o
[346/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/__/interfaces/wallet.cpp.o
[347/482] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqrpc.cpp.o
[348/482] Building CXX object src/zmq/CMakeFiles/zmq.dir/zmqpublishnotifier.cpp.o
[349/482] Building CXX object src/seeder/CMakeFiles/bitcoin-seeder.dir/main.cpp.o
[350/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/walletdb.cpp.o
[351/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/scriptpubkeyman.cpp.o
[352/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcdump.cpp.o
[353/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/wallet.cpp.o
[354/482] Building CXX object src/wallet/CMakeFiles/wallet.dir/rpcwallet.cpp.o
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Snippet of first build failure:

[348/409] Running utility command for check-bitcoin-torcontrol_tests
[349/409] bitcoin: testing settings_tests
[350/409] Running utility command for check-bitcoin-settings_tests
[351/409] bitcoin: testing streams_tests
[352/409] bitcoin: testing timedata_tests
[353/409] Running utility command for check-bitcoin-streams_tests
[354/409] Running utility command for check-bitcoin-timedata_tests
[355/409] bitcoin: testing checkdatasig_tests
[356/409] Running utility command for check-bitcoin-checkdatasig_tests
[357/409] bitcoin: testing uint256_tests
[358/409] Running utility command for check-bitcoin-uint256_tests
[359/409] bitcoin: testing walletdb_tests
[360/409] bitcoin: testing undo_tests
[361/409] bitcoin: testing serialize_tests
[362/409] bitcoin: testing sigencoding_tests
[363/409] Running utility command for check-bitcoin-walletdb_tests
[364/409] Running utility command for check-bitcoin-undo_tests
[365/409] Running utility command for check-bitcoin-serialize_tests
[366/409] Running utility command for check-bitcoin-sigencoding_tests
[367/409] bitcoin: testing util_threadnames_tests
[368/409] Running utility command for check-bitcoin-util_threadnames_tests
[369/409] bitcoin: testing script_standard_tests
[370/409] bitcoin: testing radix_tests
[371/409] Running utility command for check-bitcoin-radix_tests
[372/409] Running utility command for check-bitcoin-script_standard_tests
[373/409] bitcoin: testing blockcheck_tests
[374/409] Running utility command for check-bitcoin-blockcheck_tests
[375/409] bitcoin: testing blockstatus_tests
[376/409] Running utility command for check-bitcoin-blockstatus_tests
[377/409] bitcoin: testing ismine_tests
[378/409] Running utility command for check-bitcoin-ismine_tests
[379/409] bitcoin: testing crypto_tests
[380/409] bitcoin: testing cashaddr_tests
[381/409] bitcoin: testing versionbits_tests
[382/409] Running utility command for check-bitcoin-cashaddr_tests
[383/409] Running utility command for check-bitcoin-crypto_tests
[384/409] Running utility command for check-bitcoin-versionbits_tests
[385/409] bitcoin: testing getarg_tests
[386/409] Running utility command for check-bitcoin-getarg_tests
[387/409] bitcoin: testing bswap_tests
[388/409] Running utility command for check-bitcoin-bswap_tests
[389/409] bitcoin: testing script_tests
[390/409] bitcoin: testing validation_tests
[391/409] Running utility command for check-bitcoin-script_tests
[392/409] bitcoin: testing validation_block_tests
[393/409] Running utility command for check-bitcoin-validation_tests
[394/409] Running utility command for check-bitcoin-validation_block_tests
[395/409] bitcoin: testing skiplist_tests
[396/409] Running utility command for check-bitcoin-skiplist_tests
[397/409] bitcoin: testing util_tests
[398/409] Running utility command for check-bitcoin-util_tests
[399/409] bitcoin: testing op_reversebytes_tests
[400/409] bitcoin: testing cuckoocache_tests
[401/409] Running utility command for check-bitcoin-op_reversebytes_tests
[402/409] Running utility command for check-bitcoin-cuckoocache_tests
[403/409] bitcoin: testing coins_tests
[404/409] Running utility command for check-bitcoin-coins_tests
[405/409] bitcoin: testing transaction_tests
[406/409] Running utility command for check-bitcoin-transaction_tests
Build build-clang timed out after 1200.0s
Fabien requested changes to this revision.Oct 1 2020, 11:05
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/interfaces/handler.cpp
30 ↗(On Diff #24103)

braces

35 ↗(On Diff #24103)

dito

This revision now requires changes to proceed.Oct 1 2020, 11:05
This revision is now accepted and ready to land.Oct 1 2020, 12:33