aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-05-24 21:59:54 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-07-08 11:18:35 -0300
commit111ea3ab711414236f8678566a7884d48619b2d8 (patch)
tree5d4fa02e5aeb208d51f268dec3e6bcf1350e0a98 /src/qt
parent22351725bc4c5eb63ee45f607374bbf2d76e2b8c (diff)
downloadbitcoin-111ea3ab711414236f8678566a7884d48619b2d8.tar.xz
wallet: refactor GetNewDestination, use BResult
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/addresstablemodel.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp
index 27ee9509e6..bb50b5384a 100644
--- a/src/qt/addresstablemodel.cpp
+++ b/src/qt/addresstablemodel.cpp
@@ -370,23 +370,21 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
else if(type == Receive)
{
// Generate a new address to associate with given label
- CTxDestination dest;
- if(!walletModel->wallet().getNewDestination(address_type, strLabel, dest))
- {
+ auto op_dest = walletModel->wallet().getNewDestination(address_type, strLabel);
+ if (!op_dest) {
WalletModel::UnlockContext ctx(walletModel->requestUnlock());
- if(!ctx.isValid())
- {
+ if (!ctx.isValid()) {
// Unlock wallet failed or was cancelled
editStatus = WALLET_UNLOCK_FAILURE;
return QString();
}
- if(!walletModel->wallet().getNewDestination(address_type, strLabel, dest))
- {
+ op_dest = walletModel->wallet().getNewDestination(address_type, strLabel);
+ if (!op_dest) {
editStatus = KEY_GENERATION_FAILURE;
return QString();
}
}
- strAddress = EncodeDestination(dest);
+ strAddress = EncodeDestination(op_dest.GetObj());
}
else
{