mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
rpc: add descriptorprocesspsbt rpc
This RPC can be the Updater, Signer, and optionally the Input Finalizer for a psbt, and has no interaction with the Bitcoin Core wallet.
This commit is contained in:
@@ -1126,7 +1126,7 @@ std::pair<int64_t, int64_t> ParseDescriptorRange(const UniValue& value)
|
||||
return {low, high};
|
||||
}
|
||||
|
||||
std::vector<CScript> EvalDescriptorStringOrObject(const UniValue& scanobject, FlatSigningProvider& provider)
|
||||
std::vector<CScript> EvalDescriptorStringOrObject(const UniValue& scanobject, FlatSigningProvider& provider, const bool expand_priv)
|
||||
{
|
||||
std::string desc_str;
|
||||
std::pair<int64_t, int64_t> range = {0, 1000};
|
||||
@@ -1159,6 +1159,9 @@ std::vector<CScript> EvalDescriptorStringOrObject(const UniValue& scanobject, Fl
|
||||
if (!desc->Expand(i, provider, scripts, provider)) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys: '%s'", desc_str));
|
||||
}
|
||||
if (expand_priv) {
|
||||
desc->ExpandPrivate(/*pos=*/i, provider, /*out=*/provider);
|
||||
}
|
||||
std::move(scripts.begin(), scripts.end(), std::back_inserter(ret));
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user