lib/edenchain/developer/bounty/blockchain/chain.rb
# Initial starting parameters for the Proof of Work (PoW) implementation
Initial starting parameters for the Proof of Work (PoW) implementation
Initial starting parameters for the Proof of Work ( PoW ) implementation
def proof_of_work_difficulty
            if @proof_of_work[:enabled]
              log("Proof of Work is enabled. Current Proof of Work difficulty: #{@proof_of_work[:difficulty].length}. Current block height: #{@block_height}")
              if @block_height % PROOF_OF_WORK[:increase_every] == 0
                count                          =   (@block_height / PROOF_OF_WORK[:increase_every])
                unless count.zero?
                  @proof_of_work[:difficulty] +=   "0"
                  log("Proof of Work difficulty has now been increased since we've reached a new block height that should trigger a new difficulty level. Current Proof of Work difficulty: #{@proof_of_work[:difficulty].length}. Current block height: #{@block_height}")
                end
              end
            end
            return @proof_of_work[:difficulty]
          end
def proof_of_work_difficulty if @proof_of_work [ :enabled ] log ( "Proof of Work is enabled. Current Proof of Work difficulty: #{@proof_of_work[:difficulty].length}. Current block height: #{@block_height}" ) if @block_height % PROOF_OF_WORK [ :increase_every ] == 0 count = ( @block_height / PROOF_OF_WORK [ :increase_every ] ) unless count . zero? @proof_of_work [ :difficulty ] += "0" log ( "Proof of Work difficulty has now been increased since we've reached a new block height that should trigger a new difficulty level. Current Proof of Work difficulty: #{@proof_of_work[:difficulty].length}. Current block height: #{@block_height}" ) end end end return @proof_of_work [ :difficulty ] end
Initial starting parameters for the Proof of Work (PoW) implementation
Initial starting parameters for the Proof of Work ( PoW ) implementation