wallet: refactor GetNewDestination, use BResult

This commit is contained in:
furszy
2022-05-24 21:59:54 -03:00
parent 22351725bc
commit 111ea3ab71
13 changed files with 72 additions and 86 deletions

View File

@@ -47,12 +47,11 @@ static void BenchUnloadWallet(std::shared_ptr<CWallet>&& wallet)
static void AddTx(CWallet& wallet)
{
bilingual_str error;
CTxDestination dest;
wallet.GetNewDestination(OutputType::BECH32, "", dest, error);
const auto& dest = wallet.GetNewDestination(OutputType::BECH32, "");
assert(dest.HasRes());
CMutableTransaction mtx;
mtx.vout.push_back({COIN, GetScriptForDestination(dest)});
mtx.vout.push_back({COIN, GetScriptForDestination(dest.GetObj())});
mtx.vin.push_back(CTxIn());
wallet.AddToWallet(MakeTransactionRef(mtx), TxStateInactive{});