How to read a tx's comment?

0

How can I retrieve the comment field from a payment transaction that I made from my QT wallet?

I can see the comment when I click "Show transaction details" in my QT but I cannot find a way to do this from the RPC console.

Any ideas?

Doug Peters

Posted 2015-03-28T14:16:10.427

Reputation: 1 326

1I believe it's either listtransactions or listunspent. I am certain send and move accept a message parameter.Wizard Of Ozzie 2015-03-28T15:50:36.383

Answers

3

Use the listtransactions RPC call, and look for a field named comment:

$ bitcoin-cli listtransactions
[
...
    {
        "account" : "",
        "address" : "msj42CCGruhRsFrGATiUuh25dtxYtnpbTx",
        "category" : "send",
        "amount" : -0.00001000,
        "vout" : 0,
        "fee" : -0.00000225,
        "confirmations" : 0,
        "txid" : "0ecdc2da9266635349ad04b7374eb1032919c34e7949e60cec198b47e31d2f26",
        "walletconflicts" : [
        ],
        "time" : 1427561024,
        "timereceived" : 1427561024,
        "comment" : "COMMENT" <--- Here
    },
...
]

Note that this comment only exists in your wallet, and is not sent across the network. The other party to the transaction will not see it.

Nick ODell

Posted 2015-03-28T14:16:10.427

Reputation: 26 536

Ah, you beat me to it! Here's Python code to check: https://gist.github.com/anonymous/fa9f193774ca76812121

Wizard Of Ozzie 2015-03-29T03:12:41.473