unit-e icon indicating copy to clipboard operation
unit-e copied to clipboard

Correctly show non-regular transactions in filtertransactions

Open nzmdn opened this issue 6 years ago • 3 comments

The current implementation of the filtertransactions RPC method was designed for regular and Bitcoin-style coinbase transactions. It should correctly show new coinbase and other types of transactions (or explicitly ignore some of them).

List of transaction types:

  REGULAR = 0,
  COINBASE = 1,
  DEPOSIT = 2,
  VOTE = 3,
  LOGOUT = 4,
  SLASH = 5,
  WITHDRAW = 6,
  ADMIN = 7

Example of a new coinbase transaction in the filtertransactions output:

{
  'confirmations': 100,
  'generated': True,
  'blockhash': '7bd7e92169ae5b076442c64dcb37547adb0bc124674fb9481fac177d287db0f7',
  'blockindex': 0,
  'blocktime': 1388594400,
  'txid': 'fcde5f23df7d49d30fcb039d426e016ed61ac60ca21474b4032b086704b8fbeb',
  'walletconflicts': [],
  'time': 1388594400,
  'timereceived': 1388594400,
  'bip125-replaceable': 'no',
  'abandoned': 0,
  'fee': Decimal('50.00000000'),
  'category': 'immature',
  'outputs': [{'vout': 2, 'amount': Decimal('0E-8')}],
  'amount': Decimal('0E-8')
}

nzmdn avatar Mar 13 '19 14:03 nzmdn

Related todos: https://github.com/dtr-org/unit-e/blob/c139675bf896dfcd5657ead6605d9494750e09be/src/wallet/rpcwalletext.cpp#L514 https://github.com/dtr-org/unit-e/blob/c139675bf896dfcd5657ead6605d9494750e09be/test/functional/rpc_filtertransactions.py#L175

nzmdn avatar Mar 19 '19 15:03 nzmdn

Regarding the first TODO : as far as I understand, in Particl the listStaked was meant to display the remotely staked transactions that are slowly being deposited on a remote node "for free" as we mine blocks. This is not a usecase that we explicitly support in Unit-e, so I'll just drop that branch entirely, if no one objects?

cmihai avatar Apr 12 '19 11:04 cmihai

I'm not sure listStaked was meant to be used only for cold staking. But we definitely can live without it.

nzmdn avatar Apr 12 '19 17:04 nzmdn