[SON for Bitcoin] Fix "Transaction already in block chain" error #402

Closed
opened 2022-07-18 17:13:15 +00:00 by serkixenos · 3 comments
serkixenos commented 2022-07-18 17:13:15 +00:00 (Migrated from gitlab.com)
Jul 18 12:23:14 irona2 witness_node[1767]: 1394182ms th_a       sidechain_net_handler.cpp:524 operator()           ] Sidechain transaction to send: 1.39.5
Jul 18 12:23:14 irona2 witness_node[1767]: 1394189ms th_a       sidechain_net_handler_bitcoin.cpp:870 sendrawtransaction   ] Bitcoin RPC call sendrawtransaction with body {"jsonrpc": "1.0", "id":"sendrawtransaction", "method": "sendrawtr> failed with reply '{"result":null,"error":{"code":-27,"message":"Transaction already in block chain"},"id":"sendrawtransaction"}
Jul 18 12:23:14 irona2 witness_node[1767]: 1394189ms th_a       sidechain_net_handler.cpp:529 operator()           ] Sidechain transaction not sent: 1.39.5

When this error appears, transaction should be immediately marked as sent. This is achieved by returning transaction hash from

std::string sidechain_net_handler_bitcoin::send_transaction(const sidechain_transaction_object &sto)

Make sure that the following line executes properly:
std::string res = bitcoin_client->sendrawtransaction(final_tx_hex);

Eg if sendrawtransaction fails with the following message, bitcoin_client->sendrawtransaction(final_tx_hex) should return transaction has instead of empty string.

``` Jul 18 12:23:14 irona2 witness_node[1767]: 1394182ms th_a sidechain_net_handler.cpp:524 operator() ] Sidechain transaction to send: 1.39.5 Jul 18 12:23:14 irona2 witness_node[1767]: 1394189ms th_a sidechain_net_handler_bitcoin.cpp:870 sendrawtransaction ] Bitcoin RPC call sendrawtransaction with body {"jsonrpc": "1.0", "id":"sendrawtransaction", "method": "sendrawtr> failed with reply '{"result":null,"error":{"code":-27,"message":"Transaction already in block chain"},"id":"sendrawtransaction"} Jul 18 12:23:14 irona2 witness_node[1767]: 1394189ms th_a sidechain_net_handler.cpp:529 operator() ] Sidechain transaction not sent: 1.39.5 ``` When this error appears, transaction should be immediately marked as sent. This is achieved by returning transaction hash from std::string sidechain_net_handler_bitcoin::send_transaction(const sidechain_transaction_object &sto) Make sure that the following line executes properly: std::string res = bitcoin_client->sendrawtransaction(final_tx_hex); Eg if sendrawtransaction fails with the following message, bitcoin_client->sendrawtransaction(final_tx_hex) should return transaction has instead of empty string.
serkixenos commented 2022-07-18 17:13:43 +00:00 (Migrated from gitlab.com)

assigned to @hirunda

assigned to @hirunda
serkixenos commented 2022-07-18 17:59:08 +00:00 (Migrated from gitlab.com)

changed title from [SON for Bitcoin] Fix to [SON for Bitcoin] Fix{+ "Transaction already in block chain" error+}

changed title from **[SON for Bitcoin] Fix** to **[SON for Bitcoin] Fix{+ "Transaction already in block chain" error+}**
serkixenos commented 2022-07-26 13:32:05 +00:00 (Migrated from gitlab.com)
Will be tested in https://gitlab.com/PBSA/peerplays/-/issues/403
serkixenos (Migrated from gitlab.com) closed this issue 2022-07-26 13:32:06 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#402
No description provided.