Issue with Broadcasting Transaction When Including Message Field in ARDOR sendMoney API

I successfully ran the node following the guide (Deploying the Ardor Node Docker Image) and completed the block synchronization up to the latest block.

However, I am testing the transfer of ARDOR using requestType=sendMoney, but an error occurred.

When I send the request with the broadcast option set to false and no message field, then locally sign the received unsigned transaction with my wallet and broadcast it, it works fine. However, when I add a message field and properly set the messageIsPrunable, and then locally sign and broadcast, I get the following error:

{"errorDescription":"Failed to broadcast transaction: Message has been pruned prematurely","errorCode":4,"requestProcessingTime":19,"error":"nxt.NxtException$NotCurrentlyValidException: Message has been pruned prematurely"}

On the other hand, if I don't perform local signing and instead put the message field in sendMoney and set broadcast to true, the transaction is broadcast successfully.

Could you help me identify what might be causing the issue?

3 Likes

@petko.petkov :pray:

3 Likes

I suspect that you are using the API when you do these operations, not the UI? It would be useful to provide the exact requests you do as curl commands (for example). Be careful not to publish your secrets here! E.g. you probably created the unsigned bytes with something like

curl -d 'chain=1&requestType=sendMoney&message=testmsg&messageIsPrunable=true&broadcast=false&recipient=1000000&amountNQT=1000000&publicKey=0507916d19b81d9f714c4f9eaf7ad4742b013c106c34cb9d2fb663d5e101df75' http://localhost:26876/nxt

Then you get the unsignedTransactionBytes from the response, sign it locally and then try to broadcast it probably with requestType=broadcastTransaction.

The unsignedTransactionBytes contains only the hash of the prunable message and your problem is most probably that you don't provide the prunableAttachmentJSON to the broadcastTransaction request. In my example that JSON should be

{"version.PrunablePlainMessage":1,"messageIsText":true,"message":"testmsg"}
3 Likes