@@ -342,15 +342,19 @@ where
342
342
// unwrap() safety: len() > 0 is checked above
343
343
let pos = * indexes. first ( ) . unwrap ( ) as usize ;
344
344
if let Some ( tx) = maybe_await ! ( self . client. get_tx( & txid) ) ? {
345
- let txid = tx. txid ( ) ;
345
+ if tx. txid ( ) != * txid {
346
+ log_error ! ( self . logger, "Retrieved transaction for txid {} doesn't match expectations. This should not happen. Please verify server integrity." , txid) ;
347
+ return Err ( InternalError :: Failed ) ;
348
+ }
349
+
346
350
if let Some ( block_height) = known_block_height {
347
351
// We can take a shortcut here if a previous call already gave us the height.
348
- return Ok ( Some ( ConfirmedTx { tx, txid, block_header, pos, block_height } ) ) ;
352
+ return Ok ( Some ( ConfirmedTx { tx, txid : * txid , block_header, pos, block_height } ) ) ;
349
353
}
350
354
351
355
let block_status = maybe_await ! ( self . client. get_block_status( & block_hash) ) ?;
352
356
if let Some ( block_height) = block_status. height {
353
- return Ok ( Some ( ConfirmedTx { tx, txid, block_header, pos, block_height } ) ) ;
357
+ return Ok ( Some ( ConfirmedTx { tx, txid : * txid , block_header, pos, block_height } ) ) ;
354
358
} else {
355
359
// If any previously-confirmed block suddenly is no longer confirmed, we found
356
360
// an inconsistency and should start over.
0 commit comments