Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error - Imported outputs omit more outputs that we know of #104

Open
will-yjn opened this issue Sep 7, 2022 · 1 comment
Open

Error - Imported outputs omit more outputs that we know of #104

will-yjn opened this issue Sep 7, 2022 · 1 comment

Comments

@will-yjn
Copy link

will-yjn commented Sep 7, 2022

The view-only wallet by default exports outputs since the last export. But if I create a new offline wallet (createWalletFull), and then sign a transaction, it will throw an error: offlineWallet.signTx Error: Error - Imported outputs omit more outputs that we know of.

async function signTx(params){

    const offlineWallet = await createWalletFull({
        networkType: MoneroNetworkType.MAINNET,
        privateSpendKey: privateKey,
        primaryAddress: from,
        password: "password",
        accountLookahead: accountLookahead === undefined ? 1 : accountLookahead,
        subaddressLookahead: subaddressLookahead === undefined ? 50000 : subaddressLookahead,
    });

    await offlineWallet.importOutputs(outputsHex);

    let signedTxHex;
    try{
        signedTxHex = await offlineWallet.signTxs(unsignedHex);
    }catch(error: any){
        throw Error("offlineWallet.signTx Error: " + (error || error.msg));
    }

    return signedTxHex;
}

Of course I could export all outputs, but what if there are too many outputs and the output_hex is too large. One http request could only carry so much data. Why can't a offline wallet sign a transaction based on the outputs since the last export and their respective unsignedHex?

@woodser
Copy link
Owner

woodser commented Sep 9, 2022

This question is better suited for monero-project devs (#monero-dev) since the library is a straight passthrough.

but what if there are too many outputs and the output_hex is too large.

There's an effort to export outputs in chunks to avoid too much data: monero-project/monero#8513

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

No branches or pull requests

2 participants