How to put comment when use sendrawtransaction in bitcoincore?

0

I use sendrawtransaction to submitt my transaction and I want to put comment or comment-to in transaction like sendtoaddress fields that store in the wallet and not sent with transactions. I think the "data": "hex" field in createrawtransaction is for this, but I can not use that.

I use the following list as recipients field in createrawtransaction, but I get error: bitcoinrpc.authproxy.JSONRPCException: -8: Invalid parameter, key-value pair must contain exactly one key

 [{'mowMh2bocyV97NUP9vqVsuCPcJ2XhJUuoH': Decimal('0.000123'),
 '2NAJPzU1pVTcNABNrdrD336eRWRrbKBBuSe': Decimal('0.03149347')},
 {'data': 'happy birthday'}]

How to use that? Is there any good idea to do this?

H.Mohseni

Posted 2019-09-15T11:21:59.587

Reputation: 9

Answers

0

data is meant for OP_RETURN outputs.

You cannot add comments using sendrawtransaction.

Raghav Sood

Posted 2019-09-15T11:21:59.587

Reputation: 10 897

Do you have any idea to put comment?H.Mohseni 2019-09-15T11:47:28.277

Use sendtoaddress, or keep a map of txid:comment in an outside database.Raghav Sood 2019-09-15T11:58:09.500