lib/zold/node/nodup_entrance.rb in zold-0.14.28 vs lib/zold/node/nodup_entrance.rb in zold-0.14.29
- old
+ new
@@ -57,11 +57,12 @@
Tempfile.open(['', Wallet::EXTENSION]) do |f|
File.write(f, body)
wallet = Wallet.new(f.path)
wallet.refurbish
after = File.read(wallet.path)
- wallet = @wallets.find(id)
- before = wallet.exists? ? AtomicFile.new(wallet.path).read.to_s : ''
+ before = @wallets.find(id) do |w|
+ w.exists? ? AtomicFile.new(w.path).read.to_s : ''
+ end
if before == after
@log.info("Duplicate of #{id}/#{wallet.digest[0, 6]}/#{after.length}b/#{wallet.txns.count}t ignored")
return []
end
@log.info("New content for #{id} arrived, #{before.length}b before and #{after.length}b after")