raedahgroup / dcrtxmatcher

2 stars 3 forks source link

On failure to publish, do not reattempt if failure is unrecoverable #57

Open raedah opened 5 years ago

raedah commented 5 years ago

On first attempt we get the error 'Can not publish transaction from server side: SendRawTransaction failed: -40: Rejected transaction'. At this point we already know the server and network is rejecting it for a valid reason. After that the API is tried again repeatedly. This is not necessary. After the API fails, it then proceeds to 'randomly selected to publish tx' which is also unnecessary. The client wallets are also likely not recognizing the error condition and are likely treating the transaction as valid. This may cause additional spend failures if the wallets are not tracking spent outputs properly.

2018-12-19 04:16:48.116 [INF] DCMIX: Will broadcast transaction via https://testnet.dcrdata.org/insight/api/tx/send
2018-12-19 04:16:48.240 [WRN] DCMIX: Can not publish transaction from server side: SendRawTransaction failed: -40: Rejected transaction c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594: transaction 33b43f8fa56c99723f1ae115901bd4a17246da084968307efce918004db5f547 in the pool already spends the same coins
2018-12-19 04:16:53.284 [WRN] DCMIX: Can not publish transaction from server side: SendRawTransaction failed: -40: Rejected transaction c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594: transaction 33b43f8fa56c99723f1ae115901bd4a17246da084968307efce918004db5f547 in the pool already spends the same coins
2018-12-19 04:16:58.331 [WRN] DCMIX: Can not publish transaction from server side: SendRawTransaction failed: -40: Rejected transaction c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594: transaction 33b43f8fa56c99723f1ae115901bd4a17246da084968307efce918004db5f547 in the pool already spends the same coins
2018-12-19 04:16:58.332 [WRN] DCMIX: Will publish from client side.
2018-12-19 04:16:58.333 [INF] DCMIX: Peer 1149454414 is randomly selected to publish transaction c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594                                                                                                                                                             
2018-12-19 04:16:58.481 [INF] DCMIX: Peer 1149454414 disconnected from client with joint session state StateTxPublish.
2018-12-19 04:16:58.481 [INF] DCMIX: Remove peer 1149454414 from join session
2018-12-19 04:16:58.482 [INF] DCMIX: Peer 68927057 is randomly selected to publish tx c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594
2018-12-19 04:16:58.619 [INF] DCMIX: Peer 68927057 disconnected from client with joint session state StateTxPublish.
2018-12-19 04:16:58.619 [INF] DCMIX: Remove peer 68927057 from join session
2018-12-19 04:16:58.620 [INF] DCMIX: Peer 1645111219 is randomly selected to publish tx c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594
2018-12-19 04:16:58.775 [INF] DCMIX: Peer 1645111219 disconnected from client with joint session state StateTxPublish.
2018-12-19 04:16:58.775 [INF] DCMIX: Remove peer 1645111219 from join session
2018-12-19 04:16:58.776 [INF] DCMIX: Peer 1749186674 is randomly selected to publish tx c75d9356bcedb672477011fed4e017dbe3264e12b9bd45937f524781d667b594
2018-12-19 04:16:58.925 [INF] DCMIX: Peer 1749186674 disconnected from client with joint session state StateTxPublish.
2018-12-19 04:16:58.926 [INF] DCMIX: Remove peer 1749186674 from join session
2018-12-19 04:17:18.344 [INF] DCMIX: Timeout.
2018-12-19 04:17:18.344 [INF] DCMIX: No peer connected, session 1639846536 terminates.