lib/zold/patch.rb in zold-0.26.10 vs lib/zold/patch.rb in zold-0.26.11
- old
+ new
@@ -160,19 +160,18 @@
# Returns TRUE if the file was actually modified
def save(file, overwrite: false)
raise 'You have to join at least one wallet in' if empty?
before = ''
- before = OpenSSL::Digest::SHA256.file(file).hexdigest if File.exist?(file)
wallet = Wallet.new(file)
+ before = wallet.digest if wallet.exists?
wallet.init(@id, @key, overwrite: overwrite, network: @network)
File.open(file, 'a') do |f|
@txns.each do |txn|
f.print "#{txn}\n"
end
end
wallet.refurbish
- after = OpenSSL::Digest::SHA256.file(file).hexdigest
- before != after
+ before != wallet.digest
end
end
end