Merge pull request #1758 from RafaelTaranto/backport/check-package-hash-blockchain

LAM-601 backport: check package hash blockchain
This commit is contained in:
Rafael Taranto 2024-11-29 13:48:03 +00:00 committed by GitHub
commit 3086bd9612
8 changed files with 43 additions and 0 deletions

View file

@ -27,6 +27,10 @@ function updateCore (coinRec, isCurrentlyRunning) {
common.logger.info('Updating Bitcoin Core. This may take a minute...')
!isDevMode() && common.es(`sudo supervisorctl stop bitcoin`)
common.es(`curl -#o /tmp/bitcoin.tar.gz ${coinRec.url}`)
if (common.es(`sha256sum /tmp/bitcoin.tar.gz | awk '{print $1}'`).trim() !== coinRec.urlHash) {
common.logger.info('Failed to update Bitcoin Core: Package signature do not match!')
return
}
common.es(`tar -xzf /tmp/bitcoin.tar.gz -C /tmp/`)
common.logger.info('Updating wallet...')