mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Abstract out IsSegWitOutput from utxoupdatepsbt
This is not a pure refactor; additional functionality is added in IsSegWitOutput which lets it recurse into P2SH when a SigningProvider is provided that knows about the inner script.
This commit is contained in:
@@ -1540,9 +1540,7 @@ UniValue utxoupdatepsbt(const JSONRPCRequest& request)
|
||||
|
||||
const Coin& coin = view.AccessCoin(psbtx.tx->vin[i].prevout);
|
||||
|
||||
std::vector<std::vector<unsigned char>> solutions_data;
|
||||
txnouttype which_type = Solver(coin.out.scriptPubKey, solutions_data);
|
||||
if (which_type == TX_WITNESS_V0_SCRIPTHASH || which_type == TX_WITNESS_V0_KEYHASH || which_type == TX_WITNESS_UNKNOWN) {
|
||||
if (IsSegWitOutput(DUMMY_SIGNING_PROVIDER, coin.out.scriptPubKey)) {
|
||||
input.witness_utxo = coin.out;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user