Duplicate send entries when opening URI from command line #17025

issue Sjors opened this issue on October 2, 2019
  1. Sjors commented at 4:12 PM on October 2, 2019: member

    Opening a URI like bitcoin:bcrt1qu7nl0nxfqwhrrf6v0t60asvq3dympgqdhg03rn?amount=0.00010000 from Chrome on macOS still works as it should.

    But opening it through the console, e.g. /Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt bitcoin:bcrt1qu7nl0nxfqwhrrf6v0t60asvq3dympgqdhg03rn?amount=0.00010000 leads to a duplicate entry on the send screen.

    So on macOS it's annoying when debugging the send screen, but otherwise harmless. But we should test the URI handler on different platforms.

    Introduced by #16578.

  2. Sjors added the label Bug on Oct 2, 2019
  3. Sjors cross-referenced this on Oct 2, 2019 from issue Do not pass in command line arguments to QApplication by achow101
  4. laanwj commented at 4:40 PM on October 2, 2019: member

    I don't understand how not passing the arguments to qt can result in a duplicate entry. Are you sure it's caused by that? Any idea why?

  5. Sjors commented at 5:13 PM on October 2, 2019: member

    I tried before and after that commit, so pretty sure it's the one that introduced it. I don't understand why either. It sounds like the URI gets passed in twice. cc @achow101

  6. laanwj commented at 5:20 PM on October 2, 2019: member

    What are the values of argc and argv[...]?

  7. jonasschnelli commented at 5:28 PM on October 2, 2019: contributor

    I can't reproduce that. ./src/qt/bitcoin-qt --regtest "bitcoin:bcrt1qu7nl0nxfqwhrrf6v0t60asvq3dympgqdhg03rn?amount=0.00010000" results in a single entry in the send screen (macOS 10.14.6).

  8. MarcoFalke added this to the milestone 0.19.0 on Oct 2, 2019
  9. luke-jr commented at 5:36 PM on October 2, 2019: member

    Did you clear the one you opened from the browser, before trying to open it at the command line?

    IIRC, opening multiple links in succession adds them to the same send as new recipients...

  10. promag commented at 5:39 PM on October 2, 2019: member

    I can reproduce with @jonasschnelli command.

  11. promag commented at 5:43 PM on October 2, 2019: member

    Adding a breakpoint at parseBitcoinURI I get two interruptions:

      * frame [#0](/github-metadata-backup-bitcoin-bitcoin/0/): 0x0000000100029e83 bitcoin-qt`GUIUtil::parseBitcoinURI(uri=QString @ 0x00007ffeefbff4b8, out=0x00007ffeefbff4c0) at guiutil.cpp:173:10 [opt]
        frame [#1](/github-metadata-backup-bitcoin-bitcoin/1/): 0x00000001000911c2 bitcoin-qt`PaymentServer::ipcParseCommandLine(node=0x0000000102cd4b90, argc=<unavailable>, argv=0x00007ffeefbff7f0) at paymentserver.cpp:113:17 [opt]
        frame [#2](/github-metadata-backup-bitcoin-bitcoin/2/): 0x000000010000d61d bitcoin-qt`GuiMain(argc=6, argv=0x00007ffeefbff7f0) at bitcoin.cpp:529:5 [opt]
    

    and

      * frame [#0](/github-metadata-backup-bitcoin-bitcoin/0/): 0x0000000100029e83 bitcoin-qt`GUIUtil::parseBitcoinURI(uri=QString @ 0x00007ffeefbfd7d8, out=0x00007ffeefbfd7e0) at guiutil.cpp:173:10 [opt]
        frame [#1](/github-metadata-backup-bitcoin-bitcoin/1/): 0x0000000100092355 bitcoin-qt`PaymentServer::handleURIOrFile(this=0x0000000102e41920, s=0x0000000102e55090) at paymentserver.cpp:325:17 [opt]
        frame [#2](/github-metadata-backup-bitcoin-bitcoin/2/): 0x0000000100092e5c bitcoin-qt`PaymentServer::uiReady(this=0x0000000102e41920) at paymentserver.cpp:274:9 [opt]
    

    Tested with f4a0d27e85.

  12. achow101 commented at 6:04 PM on October 2, 2019: member

    I don't have a mac so I can't debug this. @Sjors @promag Before and after #16578, what do you see for argc and argv after BitcoinApplication has been constructed?

  13. promag cross-referenced this on Oct 2, 2019 from issue gui: Prevent processing duplicate payment requests by promag
  14. fanquake closed this on Oct 4, 2019

  15. sidhujag referenced this in commit 284ca76638 on Oct 4, 2019
  16. laanwj cross-referenced this on Oct 18, 2019 from issue Replace #16578 with a more specific solution by laanwj
  17. PastaPastaPasta referenced this in commit 9b97cb680f on Jun 27, 2021
  18. PastaPastaPasta referenced this in commit 9a3a19336b on Jun 28, 2021
  19. PastaPastaPasta referenced this in commit 331e87dd3a on Jun 29, 2021
  20. PastaPastaPasta referenced this in commit 3863c8ab3b on Jul 1, 2021
  21. PastaPastaPasta referenced this in commit 0fd2a44c7a on Jul 1, 2021
  22. PastaPastaPasta referenced this in commit 040b920900 on Jul 12, 2021
  23. PastaPastaPasta referenced this in commit 45029ee33f on Jul 13, 2021
  24. PastaPastaPasta referenced this in commit d96e363a3f on Jul 13, 2021
  25. bitcoin locked this on Dec 16, 2021
  26. gades referenced this in commit 40a53cb541 on May 11, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC