1

I'm writing an app where I fetch and transparently display all TXs for a wallet.

When I send a POST request to the monero-wallet-rpc with the get_transfers method and the in: true parameter, I get three outputs for the same TXID.

  1. Amount is 0
  2. Very small amount
  3. Actual TX amount with added suggested_confirmations_threshold: 1 object property

I assume #2 is the TX fee, and #3 is the actual TX to the receiver. Not exactly sure what #1 is.

How can I make sense of this returned data?

Request (NodeJS):

fetch(config.xmr.wallet_RPC_URL + "/json_rpc", {
            method: "POST",
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                jsonrpc: "2.0",
                id: "0",
                method: "get_transfers",
                params: {
                    in: true
                }
            })

Response:

{
  address: 'mywalletaddr',
  amount: 0,
  confirmations: 788609,
  double_spend_seen: false,
  fee: 20000000000,
  height: 1511844,
  locked: false,
  note: '',
  payment_id: '0000000000000000',
  subaddr_index: { major: 0, minor: 0 },
  subaddr_indices: [ { major: 0, minor: 0 } ],
  timestamp: 1518905851,
  txid: 'thetxid',
  type: 'in',
  unlock_time: 0
}
{
  address: 'mywalletaddr',
  amount: 0,
  confirmations: 788609,
  double_spend_seen: false,
  fee: 20000000000,
  height: 1511844,
  locked: false,
  note: '',
  payment_id: '0000000000000000',
  subaddr_index: { major: 0, minor: 0 },
  subaddr_indices: [ { major: 0, minor: 0 } ],
  timestamp: 1518905851,
  txid: 'thetxid',
  type: 'in',
  unlock_time: 0
}
{
  address: 'mywalletaddr',
  amount: 874585636991,
  amounts: [ 874585636991 ],
  confirmations: 788609,
  double_spend_seen: false,
  fee: 20000000000,
  height: 1511844,
  locked: false,
  note: '',
  payment_id: '0000000000000000',
  subaddr_index: { major: 0, minor: 0 },
  subaddr_indices: [ { major: 0, minor: 0 } ],
  suggested_confirmations_threshold: 1,
  timestamp: 1518905851,
  txid: 'thetxid',
  type: 'in',
  unlock_time: 0
}
11
  • Please update your question with the actual request payload. – jtgrassie Feb 19 at 19:40
  • @jtgrassie done – slightly_toasted Feb 19 at 19:42
  • not the response, the request. – jtgrassie Feb 19 at 19:45
  • 1
    No it's not expected. I don't have any duplicates. You should be able to resolve with a rescan_bc from the earliest height you ever received anything. – jtgrassie Feb 19 at 20:17
  • 1
    @jtgrassie rescan_blockchain fixed it! Thank you. – slightly_toasted Feb 19 at 22:19
1

Running the rescan_blockchain method fixed the issue. Now only 1 TX is returned per TXID.

Thanks to @jtgrassie for helping resolve this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.