mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Fix can_accept for upgraded dbs.
This commit is contained in:
@@ -14,7 +14,7 @@ from typing import Optional
|
||||
|
||||
|
||||
CURRENT_DB_VERSION = 26
|
||||
CURRENT_DB_DATA_VERSION = 5
|
||||
CURRENT_DB_DATA_VERSION = 6
|
||||
|
||||
|
||||
class Concepts(IntEnum):
|
||||
|
||||
@@ -104,17 +104,19 @@ def upgradeDatabaseData(self, data_version):
|
||||
),
|
||||
cursor,
|
||||
)
|
||||
if data_version > 0 and data_version < 3:
|
||||
if data_version > 0 and data_version < 6:
|
||||
for state in BidStates:
|
||||
in_error = isErrorBidState(state)
|
||||
swap_failed = isFailingBidState(state)
|
||||
swap_ended = isFinalBidState(state)
|
||||
can_accept = canAcceptBidState(state)
|
||||
cursor.execute(
|
||||
"UPDATE bidstates SET in_error = :in_error, swap_failed = :swap_failed, swap_ended = :swap_ended WHERE state_id = :state_id",
|
||||
"UPDATE bidstates SET can_accept = :can_accept, in_error = :in_error, swap_failed = :swap_failed, swap_ended = :swap_ended WHERE state_id = :state_id",
|
||||
{
|
||||
"in_error": in_error,
|
||||
"swap_failed": swap_failed,
|
||||
"swap_ended": swap_ended,
|
||||
"can_accept": can_accept,
|
||||
"state_id": int(state),
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user