Skip to content

wallet: import_data takes an offline receipt back from export_data (#2177) - #2179

Open
profinch wants to merge 1 commit into
BeamMW:masterfrom
profinch:fix/2177-import-push-receipt
Open

profinch wants to merge 1 commit into
BeamMW:masterfrom
profinch:fix/2177-import-push-receipt

Conversation

@profinch

Copy link
Copy Markdown

Fixes #2177.

An offline (push) receipt is exported with MyAddressID but without MyAddr. ImportTransactionsFromJson checked that id against wid, still Zero with no MyAddr, so ValidateSbbsWalletID failed, the receipt was skipped and the whole import reported a failure (everything else already written). Now MyAddressID is checked only when there is a MyAddr to check it against; such a receipt imports with the existing "Cannot check imported address" warning.

Test: wallet_db_test's export/import case (TestExportImportTx) gives its push tx a MyAddressID, as a real offline receipt has. Without the fix it fails at both ImportDataFromJson checks ("Invalid MyAddressID parameter"); with it, it passes.

…eamMW#2177)

An offline (push) receipt is exported with MyAddressID but without MyAddr. The
import checked that id against an empty WalletID, rejected the receipt and so
reported the whole import as failed. MyAddressID is checked only when there is
a MyAddr to check it against.

Test: wallet_db_test's export/import case gives its push tx a MyAddressID, as a
real offline receipt has; it failed before the fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

import_data rejects a whole file that export_data wrote: offline (push) receipts with MyAddressID and no MyAddr

1 participant