diff --git a/routstr/core/db.py b/routstr/core/db.py index 586f467e..9ebb87e9 100644 --- a/routstr/core/db.py +++ b/routstr/core/db.py @@ -287,7 +287,7 @@ async def store_cashu_transaction( created_at: int | None = None, source: str = "x-cashu", api_key_hashed_key: str | None = None, -) -> None: +) -> bool: try: async with create_session() as session: tx = CashuTransaction( @@ -304,11 +304,13 @@ async def store_cashu_transaction( ) session.add(tx) await session.commit() + return True except Exception as e: logger.warning( f"Failed to store cashu transaction: {e} (type={typ})", extra={"error": str(e), "type": typ}, ) + return False class UpstreamProviderRow(SQLModel, table=True): # type: ignore