diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-04-08 16:43:10 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-07-08 11:18:35 -0300 |
commit | 22351725bc4c5eb63ee45f607374bbf2d76e2b8c (patch) | |
tree | f070e528309494f0f519be8fd590117c00f1761b /src/wallet/feebumper.cpp | |
parent | 198fcca162f4d2f877feab485e629ff89818ff56 (diff) |
send: refactor CreateTransaction flow to return a BResult<CTransactionRef>
Diffstat (limited to 'src/wallet/feebumper.cpp')
-rw-r--r-- | src/wallet/feebumper.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wallet/feebumper.cpp b/src/wallet/feebumper.cpp index 9bd7e62c28..43fdcee48d 100644 --- a/src/wallet/feebumper.cpp +++ b/src/wallet/feebumper.cpp @@ -219,18 +219,18 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo new_coin_control.m_min_depth = 1; constexpr int RANDOM_CHANGE_POSITION = -1; - bilingual_str fail_reason; - std::optional<CreatedTransactionResult> txr = CreateTransaction(wallet, recipients, RANDOM_CHANGE_POSITION, fail_reason, new_coin_control, false); - if (!txr) { - errors.push_back(Untranslated("Unable to create transaction.") + Untranslated(" ") + fail_reason); + auto res = CreateTransaction(wallet, recipients, RANDOM_CHANGE_POSITION, new_coin_control, false); + if (!res) { + errors.push_back(Untranslated("Unable to create transaction.") + Untranslated(" ") + res.GetError()); return Result::WALLET_ERROR; } + const auto& txr = res.GetObj(); // Write back new fee if successful - new_fee = txr->fee; + new_fee = txr.fee; // Write back transaction - mtx = CMutableTransaction(*txr->tx); + mtx = CMutableTransaction(*txr.tx); return Result::OK; } |