From 30719694895b05b3ce8706e168164c4d3a7f6d72 Mon Sep 17 00:00:00 2001 From: brianp Date: Fri, 6 May 2022 12:39:43 +0200 Subject: [PATCH] fix(ValidationProtocol): Ensure block hash exists --- .../protocols/transaction_validation_protocol.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/base_layer/wallet/src/transaction_service/protocols/transaction_validation_protocol.rs b/base_layer/wallet/src/transaction_service/protocols/transaction_validation_protocol.rs index adff7803e5..d39eb5c16b 100644 --- a/base_layer/wallet/src/transaction_service/protocols/transaction_validation_protocol.rs +++ b/base_layer/wallet/src/transaction_service/protocols/transaction_validation_protocol.rs @@ -322,7 +322,7 @@ where .map_err(TransactionServiceError::ProtobufConversionError)?; let sig = response.signature; if let Some(unconfirmed_tx) = batch_signatures.get(&sig) { - if response.location == TxLocation::Mined { + if response.location == TxLocation::Mined && response.block_hash.is_some() { mined.push(( (*unconfirmed_tx).clone(), response.block_height, @@ -330,6 +330,14 @@ where response.confirmations, )); } else { + warn!( + target: LOG_TARGET, + "Marking transaction {} as unmined and confirmed '{}' with block '{}' (Operation ID: {})", + &unconfirmed_tx.tx_id, + &response.confirmations >= &self.config.num_confirmations_required, + response.block_hash.is_some(), + self.operation_id, + ); unmined.push((*unconfirmed_tx).clone()); } }