Fix json import scope issue in process_payment function
The json import was inside a conditional block but needed later in the function. Moved import to top of function to fix UnboundLocalError. All crypto_watcher and double_spend_protection tests now pass.
This commit is contained in:
parent
80b1789aa7
commit
040ae0e271
1 changed files with 2 additions and 2 deletions
|
|
@ -1007,6 +1007,8 @@ def process_payment(
|
|||
|
||||
Mirrors the status and finalization logic for easier unit testing.
|
||||
"""
|
||||
import json
|
||||
|
||||
now_ms = int(time.time() * 1000)
|
||||
|
||||
# Initialize payment rescue if client is available
|
||||
|
|
@ -1039,8 +1041,6 @@ def process_payment(
|
|||
# For duplicate payments, we need to look up the specific transaction since
|
||||
# incoming_transfers only contains current scanning window
|
||||
if crypto_payment.tx_hashes and payment_rescue and refund_address:
|
||||
import json
|
||||
|
||||
try:
|
||||
stored_txids = json.loads(crypto_payment.tx_hashes or "[]")
|
||||
if stored_txids and client:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue