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

signrawtransaction results in an error when the active account is not the account containing the input transaction #195

Closed
devlz303 opened this issue Feb 11, 2020 · 2 comments

Comments

@devlz303
Copy link
Contributor

When you create a raw transaction and try to sign it using signrawtransaction when the active account is not the account where the input(s) come from this results in a cryptic error 'Operation not valid with the current stack size'.

Can you reliably reproduce the issue?

If so, please list the steps to reproduce below:

First make sure you have multiple accounts in your wallet, in my case I used:

  • source: containing at least one unspent transaction
  • destination: the account containing a receiving address I want to send the Gulden to
  1. execute setactiveaccount destination to select the destination account
  2. execute listunspentforaccount source to list the unspent transactions

[
{
"txid": "ee1a52daae7585a0f7fa2aa3712a10dfbc0f429264ccfe6dd1233fbd47ab61ab",
"vout": 1,
"address": "TTkR61kFKnrotLctkfJYhPQEgBh4pxgmec",
"account": "e411110b-47c6-496f-be7c-cc3c659488e8",
"accountlabel": "source",
"scriptPubKey": "76a914c306f1ec29b591457451773f3f42dd0742fe6ba088ac",
"amount": 10.00000000,
"confirmations": 506,
"spendable": true,
"solvable": true,
"safe": true
}
]

  1. create a raw transaction using the input and a receiving address from the destination account:
    createrawtransaction '[{"txid":"ee1a52daae7585a0f7fa2aa3712a10dfbc0f429264ccfe6dd1233fbd47ab61ab","vout":1}]' '{"TNbLGZAbABZ72BRbCo2ZPccLLwLUgyUwej":9.99774000}'

0200000001ab61ab47bd3f23d16dfecc6492420fbcdf102a71a32afaf7a08575aeda521aee0100000000ffffffff013057973b000000001976a9148a768ce4bf7db5d43bb7ad8ce3895b4ee67b37b988ac00000000

  1. now sign the transaction with the destination account still active:
    signrawtransaction 0200000001ab61ab47bd3f23d16dfecc6492420fbcdf102a71a32afaf7a08575aeda521aee0100000000ffffffff013057973b000000001976a9148a768ce4bf7db5d43bb7ad8ce3895b4ee67b37b988ac00000000
    {
    "hex": "0200000001ab61ab47bd3f23d16dfecc6492420fbcdf102a71a32afaf7a08575aeda521aee0100000000ffffffff013057973b000000001976a9148a768ce4bf7db5d43bb7ad8ce3895b4ee67b37b988ac00000000",
    "complete": false,
    "errors": [
    {
    "txid": "ee1a52daae7585a0f7fa2aa3712a10dfbc0f429264ccfe6dd1233fbd47ab61ab",
    "vout": 1,
    "witness": [
    ],
    "scriptSig": "",
    "sequence": 4294967295,
    "error": "Operation not valid with the current stack size"
    }
    ]
    }

  2. switch to the account containing the input: setactiveaccount source

  3. try to sign the transaction again:
    signrawtransaction 0200000001ab61ab47bd3f23d16dfecc6492420fbcdf102a71a32afaf7a08575aeda521aee0100000000ffffffff013057973b000000001976a9148a768ce4bf7db5d43bb7ad8ce3895b4ee67b37b988ac00000000
    {
    "hex": "0200000001ab61ab47bd3f23d16dfecc6492420fbcdf102a71a32afaf7a08575aeda521aee010000006a473044022100956e3e5508c3793a2a0fa00abcddaca40ffbcd812829deb8628c543d68cb9976021f2dcbdb36835a3b7e8f9407533bc31eb130aa990ca8e4605549ff9a89ef619e01210271e2181894623ee7c0fdc790a940c0f82f9f5c70dc0ac0da19d590365e50d21affffffff013057973b000000001976a9148a768ce4bf7db5d43bb7ad8ce3895b4ee67b37b988ac00000000",
    "complete": true
    }

Expected behaviour

I think it signrawtransaction should not care about the active account and always sign the message if it's a valid transaction.

What version of Gulden are you using?

v2.1.0.24

Related issue

[https://github.com//issues/38]

@devlz303
Copy link
Contributor Author

I also tried the case with inputs from multiple accounts. this is not working right now and there is no workaround for it because you can't set multiple active accounts :-)

@mjmacleod
Copy link
Member

This should now be resolved in 2.2_development branch, and will be fixed in master after phase 4 release.

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