use pack.pin() in pin.py

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-06-17 17:18:16 +02:00
parent 8a53ac8778
commit 58f3e524f9
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 1 additions and 9 deletions

10
pin.py
View File

@ -13,12 +13,4 @@ def pinAllPacks(ipfs, contract):
# Iterate over packs and make sure they are all pinned
for pack in packs:
LOG.info('Pinning: %s', pack)
rval = ipfs.pin(pack.content_hash)
for chash in pack.image_hashes:
LOG.debug('Pinning image: %s', chash)
pinned = ipfs.pin(chash)
if pinned:
LOG.debug('Successfully pinned: %s', chash)
else:
LOG.error('Failed to pin image: %s', chash)
pack.pin(ipfs)