make price optional then fix min/max issues.

This commit is contained in:
fiatjaf
2021-04-11 00:44:55 -03:00
parent 42cf70e158
commit 52e7a28fc2
5 changed files with 18 additions and 11 deletions
+8
View File
@@ -25,6 +25,14 @@ class Track(NamedTuple):
name: str
producer: int
@property
def min_sendable(self) -> int:
return min(100_000, self.price_msat or 100_000)
@property
def max_sendable(self) -> int:
return max(50_000_000, self.price_msat * 5)
async def fullname(self) -> str:
from .crud import get_producer