Skip to content

Commit a368f73

Browse files
committed
feat(btcreleaseclient): add logs for svp spend tx before / after removing sigs
1 parent 7da4e59 commit a368f73

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/co/rsk/federate/btcreleaseclient/BtcReleaseClient.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,23 @@ public void onBlock(org.ethereum.core.Block block, List<TransactionReceipt> rece
286286
* </p>
287287
*
288288
* @param currentBlockNumber the current block number in the blockchain
289-
* @param svpTxHash the Keccak256 hash of the svp spend transaction waiting to be signed
289+
* @param svpSpendTx the Keccak256 hash and the Bitcoin transaction of the svp spend transaction waiting to be signed
290290
* @return {@code true} if the transaction has the required number of confirmations and is ready to be signed;
291291
* {@code false} otherwise
292292
*/
293293
private boolean isSVPSpendTxReadyToSign(long currentBlockNumber, Map.Entry<Keccak256, BtcTransaction> svpSpendTx) {
294294
try {
295-
BtcTransaction btcTx = svpSpendTx.getValue();
296-
Federation spendingFed = getSpendingFederation(btcTx);
297-
removeSignaturesFromTransaction(btcTx, spendingFed);
295+
296+
BtcTransaction svpSpendTxWithoutSignatures = svpSpendTx.getValue();
297+
Federation spendingFed = getSpendingFederation(svpSpendTxWithoutSignatures);
298+
299+
logger.debug("[isSvpSpendTxReadyToSign] SVP spend tx before removing signatures [{}]", svpSpendTxWithoutSignatures);
300+
removeSignaturesFromTransaction(svpSpendTxWithoutSignatures, spendingFed);
301+
logger.debug("[isSvpSpendTxReadyToSign] SVP spend tx after removing signatures [{}]", svpSpendTxWithoutSignatures);
298302

299303
int version = signer.getVersionForKeyId(BTC.getKeyId());
300304
ReleaseCreationInformation releaseCreationInformation = releaseCreationInformationGetter.getTxInfoToSign(
301-
version, svpSpendTx.getKey(), btcTx);
305+
version, svpSpendTx.getKey(), svpSpendTxWithoutSignatures);
302306

303307
boolean isReadyToSign = Optional.ofNullable(releaseCreationInformation)
304308
.map(ReleaseCreationInformation::getPegoutCreationBlock)

0 commit comments

Comments
 (0)