Skip to content

Commit 7767fc9

Browse files
committed
Revert "[hotfix] don't update transaction status, of cancelled or successful trades, patch suspected bug of orders in status 13 being set to 99 from bad request response"
This reverts commit 1a658e2.
1 parent 582d506 commit 7767fc9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/Jobs/UpdateTransactions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct()
3333
public function handle(): void
3434
{
3535
// update all current transactions where status != 14, 12, 17, 18, 99
36-
$transactions = Transaction::whereNotIn('status', [4, 5, 14, 12, 14, 17, 18, 99])->get();
36+
$transactions = Transaction::whereNotIn('status', [5, 14, 12, 17, 18, 99])->get();
3737
foreach ($transactions as $transaction) {
3838
$offer = $transaction->offer;
3939
$robosats = new Robosats();

app/WorkerClasses/Robosats.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,11 +866,14 @@ public function updateTransactionStatus($offer) {
866866
}
867867

868868

869-
// I think robosats returns a bad_request response before trade hits a 14 completed status i.e. sending sats to the buyer, and we should just set expires_at to now rather than setting status to 99
870869
if ($offer->status < 14) {
870+
$offer->status_message = $response['bad_request'];
871+
$offer->status = 99;
871872
// set expires at to now
872873
$offer->expires_at = date('Y-m-d H:i:s');
873874
$offer->save();
875+
$transaction->status_message = $response['bad_request'];
876+
$transaction->status = 99;
874877
$transaction->save();
875878
} else {
876879
// $slackService = new SlackService();

0 commit comments

Comments
 (0)