add option "-memtxnotify" which will execute command when mempool accept a transaction #2799

pull bitkevin wants to merge 1 commits into bitcoin:master from bitkevin:add_memtx_notify changing 2 files +9 −0
  1. bitkevin commented at 5:41 PM on June 26, 2013: contributor

    Usage:

    $bitcoind -memtxnotify="/tmp/memtxnotify.sh %s"
    

    cat /tmp/memtxnotify.sh:

    #!/bin/bash
    
    F=/tmp/mempool_transaction_log
    D=`date +"%Y-%m-%d %H:%M:%S"`
    
    echo ${D} - ${1} >> ${F}
    

    tailf /tmp/mempool_transaction_log:

    2013-06-27 01:38:44 - c5c4a2bf7a44c9c4b39ae22042da6b86cbcada35f7b2fff864d9a114c65d9b94
    2013-06-27 01:38:45 - 6cc77917dfc90c518ad5aa188967ba6d04becca4f5d6f633b4afe754d8b3e21d
    2013-06-27 01:38:46 - 1fbea7b1773a9efc9f3b06e90773d159083218e256d1d9edf11669048e1f8088
    2013-06-27 01:38:49 - 99321b4748cac1f7612b9546eba01bf5fe28e8617aa3fa23487eb122759076a8
    2013-06-27 01:38:50 - 1bb1b3881d18cd674e5023a67b6c0757a587d45eb6973454852f7e295efacf92
    2013-06-27 01:39:01 - 64e3fee386ca632e97a0ce55ea58711bb73054cc0c4e6cd41fe9f6fbfbcf262b
    2013-06-27 01:39:02 - 84152de18356948583917ed2a36644cfff08c0df65b8f7add4e60efe8c1a1580
    2013-06-27 01:39:02 - 45fd501203fc4bd6f5df99ab054a8080fcd2b9acaafb05d9007a8db1b715cdea
    2013-06-27 01:39:03 - 659058f7f41e6315a780c48dc8d0d31c697c4b3b14d64de947c6a49ee33954a1
    2013-06-27 01:39:04 - 7ac0c0ea12171ee782d98a7d545573e1659d72864ac8dc7a85ce02e35544d896
    2013-06-27 01:39:11 - 5817219e8cc418c366e402a89d70dd8878455258c28b3782be8544fe78f1ff72
    2013-06-27 01:39:12 - ad03c04b56438655339a65c2f9e20106f9e7c1a991c66d8fbc933a275a84fdd1
    
  2. add -memtxnotify, Execute command when mempool accept a transaction 1f0b98fd73
  3. jgarzik commented at 7:48 PM on June 26, 2013: contributor

    This has been discussed in the past. The conclusion was: too high volume for this. You'll be constantly executing new processes. Better solutions include things such as https://github.com/jgarzik/pynode/tree/mini-node behind a trusted node.

    This is essentially "drinking from the firehose."

  4. sipa commented at 9:24 PM on June 26, 2013: member

    The ZeroMQ patch would also make things like this possibe

  5. bitkevin commented at 2:42 AM on June 27, 2013: contributor

    There is no performance problems, bitcoin avg receive transaction number is less than 7 per second, top is less than 100 per second. Script can easy hold this. Enabling this option who must understand its potential performance problems. It's simpler than 0mq and easy to use.

  6. gmaxwell commented at 3:05 AM on June 27, 2013: contributor

    A trivial fork-bomb attack for anyone who hypothesizes a node is using this feature.

  7. jgarzik commented at 3:09 AM on June 27, 2013: contributor

    Nod. Unlike blocks it is relatively easy to trigger via remote. -walletnotify is IMO borderline, even, but much harder to attack absent additional knowledge of the victim (what keys might be in wallet). -memtxnotify makes a big, easy attack surface.

  8. bitkevin closed this on Jun 28, 2013

  9. Bushstar referenced this in commit 8f280f3466 on Apr 5, 2019
  10. DrahtBot locked this on Sep 8, 2021

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-22 09:16 UTC

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