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

mandatory-script-verify-flag-failed error when I enable -ecash flag #437

Open
redred77 opened this issue Aug 7, 2021 · 2 comments
Open

Comments

@redred77
Copy link

redred77 commented Aug 7, 2021

I was using bitcoincash abc node fine before.
I create transaction manually, sign, and send on the network.
But my signed transaction is not accepted from wallet with ecash enabled latest release.

Here are some things I considered, checked.

  1. I turned on -ecash with latest release
  2. changed amount unit to match. x1000000 for my input and output values.
  3. checked that new ecash vout addresses are correctly converted to legacy address as before. I insert legacy vout address in transaction.

I get
mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)

Is XEC change some internal logic when I enable ecash?
Please advice.

@PiRK
Copy link
Contributor

PiRK commented Oct 8, 2021

Hi. The ecash flag does not change internal logic, only the unit and ticker for values displayed in the GUI and in the some RPC parameters and outputs where it previously used BCHA.

It specifically does not change values that were in satoshis. Values in satoshis should not be multiplied.

Could you be more specific about what you mean when you write that you create transaction "manually"? Are you using a RPC call ( createrawtransaction)? Or are you building them with custom scripts/programs? If it is the latter, you should not change anything. The raw transaction format has not changed, it encodes amounts as integers (satoshis). If it is createrawtransaction, then you need to use XEC amounts in the outputs.

@ccconnor
Copy link

ccconnor commented Dec 2, 2021

I setup a regtest node, and run the following command

curl --location --request POST 'http://localhost:6650' \
--header 'Authorization: Basic xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "1.0",
    "id": "curltest",
    "method": "sendtoaddress",
    "params": [
        "n4LbNgMA1LNr1CqvPHa71ndypUSQucPwpi",
        1000000
    ]
}'

Debug.log

2021-12-02T10:57:52Z [default wallet] keypool added 1 keys (1 internal), size=2000 (1000 internal)
2021-12-02T10:57:52Z [default wallet] keypool reserve 1043
2021-12-02T10:57:52Z [default wallet] keypool keep 1043
2021-12-02T10:57:52Z [default wallet] keypool added 1 keys (1 internal), size=2000 (1000 internal)
2021-12-02T10:57:52Z [default wallet] keypool reserve 1044
2021-12-02T10:57:52Z [default wallet] keypool keep 1044
2021-12-02T10:57:52Z [default wallet] Fee non-grouped = 519, grouped = 1548, using non-grouped
2021-12-02T10:57:52Z [default wallet] CommitTransaction:
CTransaction(txid=fc55160b8a, ver=2, vin.size=3, vout.size=2, nLockTime=1728)
    CTxIn(COutPoint(c48a452bd9, 0), scriptSig=473044022079f4fd95ddebc3, nSequence=4294967294)
    CTxIn(COutPoint(d77d1d79e4, 0), scriptSig=473044022060a79cc3a7fd2a, nSequence=4294967294)
    CTxIn(COutPoint(3c29a481bd, 0), scriptSig=47304402201aee6c7f65a4c4, nSequence=4294967294)
    CTxOut(nValue=0.02538543, scriptPubKey=76a91402e930228df787835bf512ab)
    CTxOut(nValue=1.00000000, scriptPubKey=76a914fa5545229d7b43d73e12d4a3)
2021-12-02T10:57:52Z [default wallet] AddToWallet fc55160b8aa002eb2336b7158fbdd48d63f818f7ca8731b4be5b9bc27a2935c1  newupdate
2021-12-02T10:57:52Z [default wallet] Submitting wtx fc55160b8aa002eb2336b7158fbdd48d63f818f7ca8731b4be5b9bc27a2935c1 to mempool for relay
2021-12-02T10:57:52Z [default wallet] CommitTransaction(): Transaction cannot be broadcast immediately, mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation)

Strangely, the last tx succeeded.

ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this issue Nov 30, 2022
This MR introduces passing DSP signals from core layer to the UI layer.
In the UI layer we add the DSP detection related to the currently opened
wallet. Upon proof arrival, an application notification will be shown,
additional information will be shown in the transaction list and transaction
info window.
To lay out the foundation for UI testing, we also introduce new `extra_args`
flag "-ui", which spawns a UI enabled node, which can be "scripted" with
RPC calls. UI tests shall be denoted with "ui_" or "ui-" prefix and will
be excluded if test runner is tasked to run all tests, because UI tests
are meant to be run separately.

Test plan:
- Run `ninja` to build project
- Run `./test/functional/test_runner.py ui-bchn-rpc-dsproof.py`.
  bitcoin-qt will be launched.
- Switch to transaction tab promptly.
- Wait 10 seconds
- An application notification with "Double Spend Proof" caption will appear.
- Transaction involved in a double spend attempt will become marked as red,
  status becomes exclamation mark.
- Double click on this transaction to view additional info related to double
  spend detected.
- Wait 10 more seconds, transaction will become mined, double spend info
  still available.

Closes Bitcoin-ABC#437
ftrader added a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this issue Nov 30, 2022
Add DSP handling in UI wallet

Closes Bitcoin-ABC#437

See merge request bitcoin-cash-node/bitcoin-cash-node!1617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants