def wait_for_confirmation(provider, transaction_id):
    'Sleep on a loop until we see a confirmation of the transaction.'
    while(True):
        transaction = provider.gettransaction(transaction_id)
        if transaction["confirmations"] > 0:
            break
        time.sleep(10)