getTransaction and getRawTransaction

+1 vote
Hi,
While going through the transaction API's i observed the following:

1) It is not possible to get the transaction details using "getTransaction" method, for transactions that are not part of your wallet.

2) However, the above condition can be circumvented by using "getRawTransaction" followed by "decodeRawTransaction" methods.Which gives all the details of a transaction thats not part of your wallet.

My question:  Is this the right observation ?  Should we be allowing detailed access to transactions which are not part of your wallet ?

Thanks in advance.
Subodh
asked Aug 5, 2016 by Subodh

1 Answer

0 votes

Yes, this is right - gettransaction (or better, getwallettransaction) provides information on a transaction from the wallet's perspective, so the transaction needs to be in the wallet. And getrawtransaction (which you can decode in directly by passing 1 for the verbose parameter) shows details of the transaction as it appears on the blockchain. Detailed access to transactions not in your wallet is one of the properties of blockchains.

answered Aug 5, 2016 by MultiChain
...