It's so annoying it hurts. I'm running wallet-rpc on testnet using the following command:
monero-wallet-rpc --daemon-host testnet.community.xmr.to --disable-rpc-login --testnet --trusted-daemon --rpc-bind-port 8885 --wallet-dir "/home/u/monero" --tx-notify "/path/to/program %s"
I'd sent some coins to my wallet using the faucet. --tx-notify has been fired! but for some unknown reasons, which may require Dumbledore's wizard skills to understand, now when calling get_transfer_by_txid
with my txid I always receive "Transaction not found"
I've tried refresh
, get_balance
, rescan_blochchain
, restarting wallet-rpc process.. Nothing works! So, RPC commands related to balance don't update even if wallet-rpc is notified by the transaction? I think it's a bug. What am I missing?
Transaction is already confirmed: https://community.xmr.to/explorer/testnet/tx/4d30019daa9b03e313bd6f27fb635cfcf4ea6078668f33766e4431b1c8930108/autorefresh
How to solve this award winning problem?
EDIT: Dumbledore may not be needed after all.
It seems the values of get_transfer_by_txid
are updated if the account receipt does not have a high index ( <=3 I guess, did not test it) otherwise "account_index" param is mandatory to scan for transfer information (even though docs say it's optional, not stating clearly the reason; I thought specifying it only had better O(n)). It's still weird that --tx-notify
is fired but wallet-rpc is not updating.
Let's say I have over 100 accounts on wallet. In case I receive a transaction via "--tx-notify", do you know a better solution to get transaction information than looping like an idiot via RPC calls through each account index? In pseudo code that may be:
for n < get_accounts
if get_transfer_by_txid {txid: ..., account_index: n} == 'tx not exists'
continue
else return "found"