diff options
author | Ava Chow <github@achow101.com> | 2024-04-23 17:13:20 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-04-23 17:20:54 -0400 |
commit | a7129f827c9de1330dea1fec739ca210e6bda3cb (patch) | |
tree | 82d109cfe5c3221293cfa0c92e0e3138a1c8558d /src/qt | |
parent | 7c17f203a5fdc697dd1cf78a9f6c6e7f49a0567d (diff) | |
parent | 4357158c4712d479522d5cd441ad4dd1693fdd05 (diff) | |
download | bitcoin-a7129f827c9de1330dea1fec739ca210e6bda3cb.tar.xz |
Merge bitcoin/bitcoin#24313: Improve display address handling for external signer
4357158c4712d479522d5cd441ad4dd1693fdd05 wallet: return and display signer error (Sjors Provoost)
dc55531087478d01fbde4f5fbb75375b672960c3 wallet: compare address returned by displayaddress (Sjors Provoost)
6c1a2cc09a00baa6ff3ff34455c2243b43067fb5 test: use h marker for external signer mock (Sjors Provoost)
Pull request description:
* HWI returns the requested address: as a sanity check, we now compare that to what we expected
* external signer documentation now reflects that HWI alternatives must implement this check
* both RPC and GUI will now return an error text, rather than just fail (the GUI even failed silently in some cases)
ACKs for top commit:
brunoerg:
ACK 4357158c4712d479522d5cd441ad4dd1693fdd05
achow101:
ACK 4357158c4712d479522d5cd441ad4dd1693fdd05
Tree-SHA512: 4f56edf3846745c8e7d08ef55cf29e8bb468256457149377c5f02da097931f9ca0c06bdbd856dc2385cde4fd11e4dc3b634c5a48814ff27f5562c8a25d43da93
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/walletmodel.cpp | 9 | ||||
-rw-r--r-- | src/qt/walletmodel.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 1bdf94d3b5..fe000bcbb8 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -569,16 +569,17 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash) return true; } -bool WalletModel::displayAddress(std::string sAddress) const +void WalletModel::displayAddress(std::string sAddress) const { CTxDestination dest = DecodeDestination(sAddress); - bool res = false; try { - res = m_wallet->displayAddress(dest); + util::Result<void> result = m_wallet->displayAddress(dest); + if (!result) { + QMessageBox::warning(nullptr, tr("Signer error"), QString::fromStdString(util::ErrorString(result).translated)); + } } catch (const std::runtime_error& e) { QMessageBox::critical(nullptr, tr("Can't display address"), e.what()); } - return res; } bool WalletModel::isWalletEnabled() diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 503ee16823..ab2096c1fe 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -130,7 +130,7 @@ public: UnlockContext requestUnlock(); bool bumpFee(uint256 hash, uint256& new_hash); - bool displayAddress(std::string sAddress) const; + void displayAddress(std::string sAddress) const; static bool isWalletEnabled(); |