Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,19 @@ internal IEnumerable<TxDestination> GetDestinations(Script redeemScript)
case TxOutType.TX_SEGWIT:
TxDestination txDestination = PayToWitTemplate.Instance.ExtractScriptPubKeyParameters(this.network, redeemScript);
if (txDestination != null)
yield return new KeyId(txDestination.ToBytes());
{
if (txDestination.ToBytes().Length == 20)
{
yield return PayToWitPubKeyHashTemplate.Instance.ExtractScriptPubKeyParameters(this.network, redeemScript);
}
else if (txDestination.ToBytes().Length == 32)
{
yield return PayToWitScriptHashTemplate.Instance.ExtractScriptPubKeyParameters(this.network, redeemScript);
}

// This should not happen, segwit scripts should generally only have one of the two valid lengths.
yield return txDestination;
}
break;
default:
if (this.scriptAddressReader is ScriptDestinationReader scriptDestinationReader)
Expand Down