From cd1e1f733c7a1fd5b1ba9988b093cd863d55511c Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 19 Mar 2021 05:28:15 +0900 Subject: [PATCH] Always set maxmempool to 300MB in bitcoin.conf (#2007) When the mempool fills up to around 500MB, this causes the mempool.space backend to crash on RPI due to OOM. Additionally, raising this above 300MB on a local RPI node arguably isn't a good idea anyway, because: * If you have a 512MB mempool and all your peers have 300MB, you'll broadcast transactions that fit in your mempool but are rejected by all of your peers * If you connect an SPV wallet to your node, your wallet will think the TX is "in the mempool" despite actually being purged from the entire Bitcoin P2P network, and never attempt to rebroadcast the purged TX * In any case, the RPI has very limited RAM, so no point in wasting RAM on having such a large sized mempool for bitcoind --- home.admin/_bootstrap.provision.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/_bootstrap.provision.sh b/home.admin/_bootstrap.provision.sh index b04376fd..4cc97885 100755 --- a/home.admin/_bootstrap.provision.sh +++ b/home.admin/_bootstrap.provision.sh @@ -149,11 +149,11 @@ kbSizeRAM=$(cat /proc/meminfo | grep "MemTotal" | sed 's/[^0-9]*//g') if [ ${kbSizeRAM} -gt 1500000 ]; then echo "Detected RAM >1GB --> optimizing ${network}.conf" sudo sed -i "s/^dbcache=.*/dbcache=1024/g" /mnt/hdd/${network}/${network}.conf - sudo sed -i "s/^maxmempool=.*/maxmempool=256/g" /mnt/hdd/${network}/${network}.conf + sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf fi if [ ${kbSizeRAM} -gt 3500000 ]; then echo "Detected RAM >3GB --> optimizing ${network}.conf" - sudo sed -i "s/^maxmempool=.*/maxmempool=512/g" /mnt/hdd/${network}/${network}.conf + sudo sed -i "s/^maxmempool=.*/maxmempool=300/g" /mnt/hdd/${network}/${network}.conf fi # link and copy HDD content into new OS on sd card