<
bitcoin-git>
bitcoin/master d9ff862 Gregory Sanders: CreateTransaction calls KeepDestination on ReserveDestination before succe...
<
bitcoin-git>
bitcoin/master e10e1e8 Gregory Sanders: Restrict lifetime of ReserveDestination to CWallet::CreateTransaction
<
bitcoin-git>
bitcoin/master 459baa1 MeshCollider: Merge #16208: wallet: Consume ReserveDestination on successful CreateTrans...
<
promag>
is it too bad to drop positional arguments? (hides)
<
achow101>
how do I return a pointer without causing a memory leak? need this for GetSigningProvider for SPKManagers
<
sipa>
you can return pointers to objects that will outlive the caller
<
achow101>
but then you have to delete them later, right?
<
sipa>
you mean a newly instantiated one?
<
sipa>
use std::unique_ptr
<
achow101>
can you return `this` as a unique_ptr?
<
sipa>
so return std::unique_ptr<SigningProvider> from the function
<
sipa>
when the returned variable goes out of scope, the signingprovider is automatically deleted
<
achow101>
I tried using shared_ptr but that didn't work
<
sipa>
unique_ptr is simpler and more efficient
<
sipa>
let me know of you need help
<
achow101>
the problem is just getting LegacyScriptPubKeyMan to return this but in the smart pointer
<
sipa>
you can't do that
<
achow101>
I figured as much
<
sipa>
but you could return a wrapper that just forwards to the internal legacy one, in a unique_ptr
<
sipa>
and then for the descriptor wallet one return an actual newly instantiated one, of a different type