mirror of
https://github.com/lnbits/lnbits.git
synced 2025-05-03 16:20:16 +02:00
feat: burn in hell token
This commit is contained in:
parent
b6d408ea71
commit
429a898ff9
@ -989,17 +989,25 @@ page_container %}
|
|||||||
},
|
},
|
||||||
|
|
||||||
burnTokens: function () {
|
burnTokens: function () {
|
||||||
for (const token of this.sendData.tokens) {
|
for (const sentToken of this.sendData.tokens) {
|
||||||
const secretIndex = this.tokens.findIndex(
|
for (const token of this.tokens) {
|
||||||
t => t.promises?.length && t.secrets.find(s => s == token.secret)
|
if (token.status === 'paid') {
|
||||||
)
|
const secretIndex = token.secrets.findIndex(
|
||||||
if (secretIndex >= 0) {
|
s => s === sentToken.secret
|
||||||
token.blindedMessages?.splice(secretIndex, 1)
|
)
|
||||||
token.promises?.splice(secretIndex, 1)
|
console.log('### secretIndex', secretIndex)
|
||||||
token.randomBlindingFactors?.splice(secretIndex, 1)
|
if (secretIndex >= 0) {
|
||||||
token.secrets?.splice(secretIndex, 1)
|
token.blindedMessages?.splice(secretIndex, 1)
|
||||||
|
token.promises?.splice(secretIndex, 1)
|
||||||
|
token.randomBlindingFactors?.splice(secretIndex, 1)
|
||||||
|
token.secrets?.splice(secretIndex, 1)
|
||||||
|
// todo: persist
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('### this.tokens', this.tokens)
|
console.log('### this.tokens', this.tokens)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user