From 77901915b711a8246e69a0604dab59812886475e Mon Sep 17 00:00:00 2001 From: Toporin Date: Wed, 6 Sep 2023 09:14:25 +0100 Subject: [PATCH] remove log debug traces from PSBTInput --- .../sparrowwallet/drongo/psbt/PSBTInput.java | 78 ------------------- 1 file changed, 78 deletions(-) diff --git a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java index 7681af4..eade24e 100644 --- a/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java +++ b/src/main/java/com/sparrowwallet/drongo/psbt/PSBTInput.java @@ -250,75 +250,6 @@ public class PSBTInput { this.index = index; } - // satochip debug - public void printDebugInfo(){ - log.debug("SATOCHIP PSBTInput printDebugInfo() START"); - // partialSignatures - try{ - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures: Map"); - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures.size(): " + partialSignatures.size()); - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures: " + partialSignatures); - for (Map.Entry entry : partialSignatures.entrySet()) { - ECKey key = entry.getKey(); - TransactionSignature value = entry.getValue(); - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures pubkey: " + Utils.bytesToHex(key.getPubKey())); - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures sig: " + Utils.bytesToHex(value.encodeToBitcoin())); - } - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures END"); - } catch(Exception e) { - log.debug("SATOCHIP PSBTInput printDebugInfo() partialSignatures exception: " + e); - } - - // derivedPublicKeys - try{ - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys: Map"); - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys.size(): " + derivedPublicKeys.size()); - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys: " + derivedPublicKeys); - for (Map.Entry entry : derivedPublicKeys.entrySet()) { - ECKey key = entry.getKey(); - KeyDerivation value = entry.getValue(); - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys pubkey: " + Utils.bytesToHex(key.getPubKey())); - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys derivation: " + value.getDerivationPath()); - } - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys END"); - } catch(Exception e) { - log.debug("SATOCHIP PSBTInput printDebugInfo() derivedPublicKeys exception: " + e); - } - - // TransactionSignature tapKeyPathSignature; - if (tapKeyPathSignature!=null) { - log.debug("SATOCHIP PSBTInput printDebugInfo() tapKeyPathSignature: " + Utils.bytesToHex(tapKeyPathSignature.encodeToBitcoin())); - } else { - log.debug("SATOCHIP PSBTInput printDebugInfo() tapKeyPathSignature: null"); - } - // ECKey tapInternalKey - if (tapInternalKey!=null) { - log.debug("SATOCHIP PSBTInput printDebugInfo() tapInternalKey: " + Utils.bytesToHex(tapInternalKey.getPubKey())); - } else { - log.debug("SATOCHIP PSBTInput printDebugInfo() tapInternalKey: null"); - } - // tapDerivedPublicKeys - - try { - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys: Map>>"); - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys.size(): " + tapDerivedPublicKeys.size()); - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys: " + tapDerivedPublicKeys); - for (Map.Entry>> entry : tapDerivedPublicKeys.entrySet()) { - ECKey key = entry.getKey(); - Map> value = entry.getValue(); - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys pubkey: " + Utils.bytesToHex(key.getPubKey())); - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys map: " + value); - } - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys END"); - } catch(Exception e) { - log.debug("SATOCHIP PSBTInput printDebugInfo() tapDerivedPublicKeys exception: " + e); - } - - log.debug("SATOCHIP PSBTInput printDebugInfo() END"); - - } - // endbug - public List getInputEntries() { List entries = new ArrayList<>(); @@ -642,15 +573,6 @@ public class PSBTInput { if(isTaproot() && tapKeyPathSignature != null) { ECKey outputKey = P2TR.getPublicKeyFromScript(getUtxo().getScript()); if(!outputKey.verify(hash, tapKeyPathSignature)) { - log.error("SATOCHIP PSBTInput verifySignatures error: " + "Tweaked internal key does not verify against provided taproot keypath signature"); - log.error("SATOCHIP PSBTInput verifySignatures error: psbtinput: " + this); - log.error("SATOCHIP PSBTInput verifySignatures error: outputKey: " + Utils.bytesToHex(outputKey.getPubKey())); - log.error("SATOCHIP PSBTInput verifySignatures error: hash: " + Utils.bytesToHex(hash.getBytes())); - log.error("SATOCHIP PSBTInput verifySignatures error: tapKeyPathSignature: " + Utils.bytesToHex(tapKeyPathSignature.encodeToBitcoin())); - log.error("SATOCHIP PSBTInput verifySignatures error: getUtxo().getScript(): " + getUtxo().getScript()); - log.error("SATOCHIP PSBTInput verifySignatures error: getUtxo(): " + getUtxo()); - log.error("SATOCHIP PSBTInput verifySignatures error: getUtxo().getHash(): " + getUtxo().getHash()); - log.error("SATOCHIP PSBTInput verifySignatures error: getUtxo().getIndex(): " + getUtxo().getIndex()); throw new PSBTSignatureException("Tweaked internal key does not verify against provided taproot keypath signature"); } } else {