mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 10:12:28 +02:00
wallet: refactor GetNewDestination, use BResult
This commit is contained in:
@@ -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{});
|
||||
|
||||
Reference in New Issue
Block a user