Fix counters in restore.

This commit is contained in:
minibits-cash
2023-12-04 00:10:32 +01:00
parent 50e9887405
commit 6fa384c8ef
4 changed files with 15 additions and 6 deletions
+3 -1
View File
@@ -179,7 +179,6 @@ export const RemoteRecoveryScreen: FC<AppStackScreenProps<'RemoteRecovery'>> = o
try {
// TODO allow input or get previous keysets from mint and try to restore from them
setStatusMessage(`Restoring from ${mint.hostname}...`)
log.info('[restore]', `Restoring from ${mint.hostname}...`)
@@ -192,6 +191,9 @@ export const RemoteRecoveryScreen: FC<AppStackScreenProps<'RemoteRecovery'>> = o
log.debug('[restore]', `Restored proofs`, proofs.length)
setStatusMessage(`Found ${proofs.length} proofs...`)
// need to move counter by ALL previous proofs!!!
mintsStore.increaseProofsCounter(mint.mintUrl, proofs.length)
if(newKeys) {updateMintKeys(mint.mintUrl as string, newKeys)}
+7
View File
@@ -816,6 +816,13 @@ const MintBalanceSelector = observer(function (props: {
text="Send now"
onPress={props.onMintBalanceConfirm}
style={{marginRight: spacing.medium}}
LeftAccessory={() => (
<Icon
icon="faArrowUp"
color="white"
size={spacing.medium}
/>
)}
// LeftAccessory={() => <Icon icon="faCoins" color="white" size={spacing.medium} containerStyle={{marginRight: spacing.small}}/>}
/>
<Button
+3 -3
View File
@@ -220,9 +220,9 @@ const sendFromMint = async function (
counter
)
log.trace('[MintClient.sendFromMint] returnedProofs', returnChange)
log.trace('[MintClient.sendFromMint] sentProofs', send)
log.trace('[MintClient.sendFromMint] newKeys', newKeys)
log.debug('[MintClient.sendFromMint] returnedProofs', returnChange)
log.debug('[MintClient.sendFromMint] sentProofs', send)
log.debug('[MintClient.sendFromMint] newKeys', newKeys)
// do some basic validations that proof amounts from mints match
const totalAmountToSendFrom = CashuUtils.getProofsAmount(proofsToSendFrom)
+2 -2
View File
@@ -1185,8 +1185,8 @@ const _sendFromMint = async function (
proofsCounter
)
log.debug('[_sendFromMint]', 'returnedProofs', returnedProofs)
log.debug('[_sendFromMint]', 'proofsToSend', proofsToSend)
// log.debug('[_sendFromMint]', 'returnedProofs', returnedProofs)
// log.debug('[_sendFromMint]', 'proofsToSend', proofsToSend)
if (newKeys) {_updateMintKeys(mintUrl, newKeys)}