monero-ecosystem/monero-python

wallet.incoming(tx_id=tx_id) doesn't return any IncomingPayment(s) when the tx is unconfirmed

Closed this issue · 1 comments

I'm not sure if this was intentional or not, if it is then feel free to close this issue.

The issue:
Scenario: A tx is currently unconfirmed / in the mem pool / not on the blockchain. The tx_id is 'abcdefg'
Code:

wallet = Wallet(JSONRPCWallet())

incoming_txs = w.incoming(tx_id='abcdefg')

Problem:
incoming_txs is an empty list : []

Work around:
Code:

incoming_txs = w.incoming(unconfirmed=True, confirmed=False)

    for tx in incoming_txs:

        if tx.transaction.hash == 'abcdefg':

            # do something

            # found tx

            break

It seems you missed unconfirmed=True kwarg in the first call. I've just run a test and cannot reproduce the error.