TransactionInput, TransactionOutput: make setParent() protected

Rather than using this method, we should prefer passing the parent
transaction via constructor.
This commit is contained in:
Andreas Schildbach 2023-03-31 19:43:43 +02:00
parent 81fb0c5acb
commit f588b8e945
2 changed files with 2 additions and 2 deletions

View file

@ -513,7 +513,7 @@ public class TransactionInput extends Message {
return DefaultRiskAnalysis.isInputStandard(this);
}
public final void setParent(@Nullable Transaction parent) {
protected final void setParent(@Nullable Transaction parent) {
if (this.parent != null && this.parent != parent && parent != null) {
// After old parent is unlinked it won't be able to receive notice if this child
// changes internally. To be safe we invalidate the parent cache to ensure it rebuilds

View file

@ -406,7 +406,7 @@ public class TransactionOutput extends Message {
return new TransactionOutput(null, Coin.valueOf(value), Arrays.copyOf(scriptBytes, scriptBytes.length));
}
public final void setParent(@Nullable Transaction parent) {
protected final void setParent(@Nullable Transaction parent) {
if (this.parent != null && this.parent != parent && parent != null) {
// After old parent is unlinked it won't be able to receive notice if this child
// changes internally. To be safe we invalidate the parent cache to ensure it rebuilds