ensure dummy y value of taproot internal key is consistent

This commit is contained in:
Craig Raw 2022-05-25 16:14:26 +02:00
parent a3ec868b75
commit 7535c876ba
2 changed files with 4 additions and 4 deletions

View file

@ -82,11 +82,11 @@ public class PSBTInput {
this.proprietary.putAll(proprietary);
this.tapInternalKey = tapInternalKey;
this.tapInternalKey = tapInternalKey == null ? null : ECKey.fromPublicOnly(tapInternalKey.getPubKeyXCoord());
if(tapInternalKey != null && !derivedPublicKeys.values().isEmpty()) {
KeyDerivation tapKeyDerivation = derivedPublicKeys.values().iterator().next();
tapDerivedPublicKeys.put(tapInternalKey, Map.of(tapKeyDerivation, Collections.emptyList()));
tapDerivedPublicKeys.put(this.tapInternalKey, Map.of(tapKeyDerivation, Collections.emptyList()));
}
this.sigHash = getDefaultSigHash();

View file

@ -45,11 +45,11 @@ public class PSBTOutput {
this.proprietary.putAll(proprietary);
this.tapInternalKey = tapInternalKey;
this.tapInternalKey = tapInternalKey == null ? null : ECKey.fromPublicOnly(tapInternalKey.getPubKeyXCoord());
if(tapInternalKey != null && !derivedPublicKeys.values().isEmpty()) {
KeyDerivation tapKeyDerivation = derivedPublicKeys.values().iterator().next();
tapDerivedPublicKeys.put(tapInternalKey, Map.of(tapKeyDerivation, Collections.emptyList()));
tapDerivedPublicKeys.put(this.tapInternalKey, Map.of(tapKeyDerivation, Collections.emptyList()));
}
}