lib/zold/node/nodup_entrance.rb in zold-0.15.0 vs lib/zold/node/nodup_entrance.rb in zold-0.16.0

- old
+ new

@@ -52,16 +52,16 @@ # Returns a list of modifed wallets (as Zold::Id) def push(id, body) raise 'Id can\'t be nil' if id.nil? raise 'Id must be of type Id' unless id.is_a?(Id) raise 'Body can\'t be nil' if body.nil? - Tempfile.open(['', Wallet::EXTENSION]) do |f| - File.write(f, body) + Tempfile.open(['', Wallet::EXT]) do |f| + IO.write(f, body) wallet = Wallet.new(f.path) wallet.refurbish - after = File.read(wallet.path) + after = IO.read(wallet.path) before = @wallets.find(id) do |w| - w.exists? ? File.read(w.path).to_s : '' + w.exists? ? IO.read(w.path).to_s : '' end if before == after @log.info( "Duplicate of #{id}/#{wallet.digest[0, 6]}/#{Size.new(after.length)}/#{wallet.txns.count}t ignored" )