Describe the bug
It might not be a bug, rather I'm missing something. In this issue, I had trouble broadcasting the transaction which was built using the Java SDK. After a while, I tried to build it with the Javascript SDK and it got broadcasted just fine, so the issue is related to Java.
To Reproduce
The transaction is built using this function:
public String Transfer(String recipient, Integer amount, String vendor, String passphrase) throws Exception {
Transfer transfer = new Transfer()
.recipient(recipient)
.amount(amount)
.vendorField(vendor);
transfer.transaction.version = 1; //By default it creates with a 0;
transfer.sign(passphrase);
if(transfer.transaction.verify() != true) throw new Exception("Transaction failed to verify");
return transfer.transaction.toJson();
}
After which I tried to broadcast the resulted JSON using the javascript client. The transaction was accepted but never appeared on the blockchain.
Expected behavior
Expected the transaction to appear on the explorer, since it was accepted.
Also I expected the version to be not 0
, so I had to manually set it to 1
.
One other thing I noticed, the resulting JSON is a bit different comparing to the javascript result.
Java result:
{
"expiration":0,
"network":0,
"timestamp":2133190,
"type":0,
"version":1,
"amount":190000000,
"fee":10000000,
"asset":{
"signature":{
},
"votes":[
],
"delegate":{
},
"multisignature":{
"min":0,
"lifetime":0,
"keysgroup":[
]
}
},
"id":"3e3185498126a06fe4b5fafe33d250f4c8183bbe755c2ebbb1de4118313f9060",
"recipientId":"ATtYCbq1MdNYHEE7zA4YZ5K8DguXRVzaz2",
"senderPublicKey":"02bd76db59c27450900c4432f63863a7e7030d2b33b1bc622b47da106a8ee3e118",
"signature":"3045022100fc8dd18b8f30ea870dd5a29c63c15327e65ec1428b95be02b75878c43b23466802207f630ad22c15fd268d7c13a198c9e8c7a4f6d90da625414bb5d13ba727ed66fa",
"vendorField":"Return tx"
}
Javascript:
{ id: 'e1257a04fd0bb89222b5a3004b2c33c13846ee4a3c4f5e15fd07cb5069407b3b',
signature: '3045022100c3324a5610d910863a7d19eb69a64acb8a10671ef283fe52d1cf1bff3e2c125302207f3a23d64ae6bfeb06ee4dcdec7f52d40db2d292d1015e3becfa9845b021ad1d',
signSignature: undefined,
timestamp: 57964888,
type: 0,
fee: 10000000,
senderPublicKey: '02bd76db59c27450900c4432f63863a7e7030d2b33b1bc622b47da106a8ee3e118',
amount: 190000000,
recipientId: 'ATtYCbq1MdNYHEE7zA4YZ5K8DguXRVzaz2',
asset: undefined,
vendorField: 'Return tx' }
Server (please complete the following information):