pull down to refresh

No worries. I run some nodes with maxmempool=1000 and some with 2000. Also much raised maxorphantx and mempoolexpiry. And of course there are much more such higher-limit-nodes. And some even keep manually rebroadcasting each transaction in the big mempool they keep, like if it was comming from them using a script like following:
#!/bin/sh USER=user:password_for_RPC_if_needed TMPL=/tmp/mempool$$ trap "rm -rfv ${TMPL}*; exit 1" EXIT INT QUIT printf "Preparing current mempool txid snapshot... " bitcoin-cli getrawmempool \ | sed '/^\[/d;/^\]/d;s/,$//;s/^ //;s/^"//;s/"$//' \ | split -l 256 -a 5 - $TMPL \ && echo done ls $TMPL* >/dev/null 2>&1 \ || { echo "Mempool empty. Sleeping."; sleep 60; exec $0; } printf "Broadcasting: " for file in $TMPL*; do { printf '[' cat $file | while read tx do test -n "$tx" || continue RAW=$(bitcoin-cli getrawtransaction $tx 2>/dev/null) || continue printf '{"jsonrpc": "1.0", "id": "send", "method": "sendrawtransaction", "params": ["%s"]},' $RAW done printf '{"jsonrpc": "1.0", "id": "getbc", "method": "getblockcount", "params": []}]\n' } | curl -s --user $USER --data-binary @- -H 'content-type: text/plain;' http://127.0.0.1:8332/ >/dev/null \ && { rm $file && printf .; } \ || { echo "ERR $file"; exit 1; } done echo done sleep 20 exec $0
@k00b thanks, the indentation of the lines is fixed!
Thank you for sharing. And for maintaining these higher-limit-nodes. Also, damn—you're good at bash! I've learned a trick or two from this script :)
reply
Happy you like it. It's actually bare POSIX shell free of any bashisms. This script runs with busybox ash and should run with OpenBSD's pdksh as well.
And @GDPR_deleted is not the author ;) The script is a public domain legacy.
reply
Old spoiler. Allow me at least one more day of fame next time please. Just kidding 😅
Yes, it's right.
reply