Complete the code to check if a transaction is confirmed.
if transaction.status == [1]: print("Transaction confirmed")
The transaction status must be "confirmed" to indicate it is successfully processed.
Complete the code to wait for 3 confirmations before proceeding.
while transaction.confirmations < [1]: wait_for_new_block()
Waiting for 3 confirmations is a common practice to ensure transaction finality.
Fix the error in the code to correctly check transaction finality.
if transaction.confirmations [1] 3: print("Transaction is final")
Transaction is final when confirmations are greater than or equal to 3.
Fill both blanks to create a dictionary of transaction IDs with their confirmation counts greater than 2.
confirmed_txs = {tx.id: tx[1] for tx in transactions if tx.confirmations [2] 2}We want the confirmation count for each transaction and only those with more than 2 confirmations.
Fill all three blanks to filter transactions with status 'confirmed' and confirmations at least 3, then map their IDs to confirmation counts.
final_txs = {tx[1]: tx[2] for tx in transactions if tx.status == [3] and tx.confirmations >= 3}This code creates a dictionary with transaction IDs as keys and their confirmation counts as values, only for confirmed transactions with at least 3 confirmations.