Bug related to blocknotify/walletnotify with Bitcoin Core on Windows. #15883

issue EAFSC opened this issue on April 24, 2019
  1. EAFSC commented at 12:11 PM on April 24, 2019: none

    This was posted back in 2014 but still applies in 2019 with the latest stable Bitcoin Core: https://bitcoin.stackexchange.com/questions/23999/blocknotify-walletnotify-but-without-the-console-window

    The blocknotify/walletnotify configuration directives, which call a command on the computer, force a brief, flickering window each time it's run which will drive anyone insane if exposed to it day after day. It's like Chinese water torture.

    I've tried every trick in the book to attempt to bypass this, but it's just not possible without modifications to the Bitcoin Core source code. I ask you to fix this (a solution is apparently in the link) so that I can run my Bitcoin payment system while using the computer and not go insane from the little windows that keep flashing by!

  2. fanquake added the label Windows on Apr 24, 2019
  3. darosior commented at 9:34 PM on April 26, 2019: member

    What command did you set to be called ? I'm trying to fix it and wanted to test under the same conditions (i'll try in a W10 VM tomorrow, feel free to try on your system too https://github.com/darosior/bitcoin/tree/windows_blocknotify_blink).

  4. EAFSC commented at 10:06 AM on April 27, 2019: none

    This:

    blocknotify =	php "C:\blablabla\handler.php" blocknotify %s
    walletnotify =	php "C:\blablabla\handler.php" walletnotify %s

    Some variants that have also been tried:

    blocknotify =	start /min php "C:\blablabla\handler.php" blocknotify %s
    blocknotify =	cmd.exe /C php "C:\blablabla\handler.php" blocknotify %s
    blocknotify =	start "" /MIN cmd.exe /C php "C:\blablabla\handler.php" blocknotify %s
  5. darosior commented at 2:24 PM on April 27, 2019: member

    This should be fixed in https://github.com/darosior/bitcoin/tree/windows_blocknotify_blink (I tested on a W10 32bits in VirtualBox with bitcoind.exe -blocknotify=C:\Windows\System32\notepad.exe). Could you give it a try ?

  6. EAFSC commented at 3:06 PM on April 27, 2019: none

    Well, I took a look and the changed code sure looks like it will work, but I can't figure out how to get a Windows binary from the Github repo. The latest file in "releases" is v0.17.1 from late 2018. If it's implied that I have to build it locally, then sorry, I can't do it. Very thankful that you fixed (probably) this, though! I look forward to the next stable Bitcoin Core release!

  7. darosior commented at 3:29 PM on April 27, 2019: member
  8. EAFSC commented at 3:41 PM on April 27, 2019: none

    Shouldn't all of this be automated so that each release (or test release) is built for all platforms at the press of a button?

  9. darosior commented at 3:54 PM on April 27, 2019: member

    No the release process is very touchy. Aren't you able to compile the sources thanks to the above link ? If you can't, you'll have to wait for a new release (in the hope that my PR is merged before the release).

  10. EAFSC commented at 5:09 PM on April 27, 2019: none

    I'm not a Bitcoin Core developer, so having to do a bunch of things is obviously unrealistic. I remember past experiences of trying to set up environments to build others' code, and it's a nightmare I will never deal with again in my life unless (maybe) under direct gun point. Still, thanks for (hopefully) fixing the bug.

  11. promag commented at 9:15 PM on April 27, 2019: contributor

    Does this happen with bitcoind, bitcoin-qt or both?

  12. EAFSC commented at 10:58 PM on April 27, 2019: none

    What do you mean?

  13. EAFSC commented at 10:59 PM on April 27, 2019: none

    I mean, I run Bitcoin Core as the normal GUI thing on Windows. It has a config. The config is where I have put the directives.

  14. ryanofsky commented at 2:07 PM on April 29, 2019: contributor

    re: #15883 (comment)

    I can't figure out how to get a Windows binary from the Github repo

    I think @DrahtBot can create binaries (https://github.com/bitcoin/bitcoin/pull/13788#issuecomment-481606552), but I'm not sure how to trigger it.

  15. fanquake added the label Needs gitian build on Apr 29, 2019
  16. fanquake commented at 2:31 PM on April 29, 2019: member

    @ryanofsky AFAIU it's triggered by the addition of the "Needs gitian build" label.

  17. fanquake removed the label Needs gitian build on Apr 30, 2019
  18. Shub77 commented at 7:58 AM on July 24, 2019: none

    This fix point to fix the problem with the Qt version running under Windows.

    I fix it changing the way the external command is invoked.

    In src/util/system.cpp , in the runCommand function, I changed:

    int nErr = ::_wsystem(std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t>().from_bytes(strCommand).c_str());

    to:

    UINT nErr = WinExec(strCommand.c_str(), SW_SHOWDEFAULT);
    if (nErr > 31) {
        nErr = 0;
    }

    Reference: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-winexec

    Now no more annoying black windows popping out when I call VLC to play a sound. But should be tested more. WARNING: surround the command with double quotes to prevent a security issue:

    blocknotify="c:\program files\dunno\whatever.exe" -A -B -C 

    Note: no further include was necessary, it compiled right as it was under WSL with mingw toolchain and tested uner Windows 10 10.0.17763.615

  19. ryanofsky commented at 2:47 PM on September 24, 2019: contributor

    #15909 was closed, but if #15382 is merged, it should make this problem easy to solve without requiring windows-specific code or expertise.

    There don't appear to be any technical problems with #15382, just indecision about #15440 and whether to allow adding boost process as an optional dependency .

  20. luke-jr commented at 2:10 AM on November 3, 2019: member

    I noticed the problem case always launches php.exe, which I assume is a command line program. What happens if you launch a non-CL program instead?

  21. pinheadmz assigned pinheadmz on Apr 27, 2023
  22. willcl-ark commented at 3:13 PM on October 14, 2024: member

    This feature request does not seem to have attracted much attention from other contributors. As such, it does not seem important enough to keep it sitting around idle in the list of open issues. Closing due to lack of interest.

    Pull requests with improvements are always welcome.

  23. willcl-ark closed this on Oct 14, 2024

  24. bitcoin locked this on Oct 14, 2025

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-04-13 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me