mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Replace CScriptID and CKeyID in CTxDestination with dedicated types
This commit is contained in:
@@ -571,7 +571,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
|
||||
if (type.isStr() && type.get_str() != "scripthash") {
|
||||
// P2SH cannot be wrapped in a P2SH. If this script is already a P2SH,
|
||||
// don't return the address for a P2SH of the P2SH.
|
||||
r.pushKV("p2sh", EncodeDestination(CScriptID(script)));
|
||||
r.pushKV("p2sh", EncodeDestination(ScriptHash(script)));
|
||||
// P2SH and witness programs cannot be wrapped in P2WSH, if this script
|
||||
// is a witness program, don't return addresses for a segwit programs.
|
||||
if (type.get_str() == "pubkey" || type.get_str() == "pubkeyhash" || type.get_str() == "multisig" || type.get_str() == "nonstandard") {
|
||||
@@ -598,7 +598,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
|
||||
segwitScr = GetScriptForDestination(WitnessV0ScriptHash(script));
|
||||
}
|
||||
ScriptPubKeyToUniv(segwitScr, sr, /* fIncludeHex */ true);
|
||||
sr.pushKV("p2sh-segwit", EncodeDestination(CScriptID(segwitScr)));
|
||||
sr.pushKV("p2sh-segwit", EncodeDestination(ScriptHash(segwitScr)));
|
||||
r.pushKV("segwit", sr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user