mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-17 14:44:20 +01:00
burn all spent tokens with cashu burn -a
This commit is contained in:
@@ -144,7 +144,7 @@ async def melt(payload: MeltPayload):
|
||||
|
||||
@app.post("/check")
|
||||
async def check_spendable(payload: CheckPayload):
|
||||
return {"spendable": await ledger.check_spendable(payload.proofs)}
|
||||
return await ledger.check_spendable(payload.proofs)
|
||||
|
||||
|
||||
@app.post("/split")
|
||||
|
||||
@@ -13,9 +13,14 @@ from core.secp import PrivateKey, PublicKey
|
||||
from core.settings import LIGHTNING, MAX_ORDER
|
||||
from core.split import amount_split
|
||||
from lightning import WALLET
|
||||
from mint.crud import (get_lightning_invoice, get_proofs_used,
|
||||
invalidate_proof, store_lightning_invoice,
|
||||
store_promise, update_lightning_invoice)
|
||||
from mint.crud import (
|
||||
get_lightning_invoice,
|
||||
get_proofs_used,
|
||||
invalidate_proof,
|
||||
store_lightning_invoice,
|
||||
store_promise,
|
||||
update_lightning_invoice,
|
||||
)
|
||||
|
||||
|
||||
class Ledger:
|
||||
@@ -219,9 +224,7 @@ class Ledger:
|
||||
|
||||
async def check_spendable(self, proofs: List[Proof]):
|
||||
"""Checks if all provided proofs are valid and still spendable (i.e. have not been spent)."""
|
||||
if not all([self._check_spendable(p) for p in proofs]):
|
||||
return False
|
||||
return True
|
||||
return {i: self._check_spendable(p) for i, p in enumerate(proofs)}
|
||||
|
||||
async def split(
|
||||
self, proofs: List[Proof], amount: int, output_data: List[BlindedMessage]
|
||||
|
||||
Reference in New Issue
Block a user