Posts

Post marked as solved
1 Replies
0 Views
I needed to wrap the code in the while loop with autoreleasepool let prefix = String(repeating: "0", count: difficulty)     var hash = calculateHash(transaction)     while !hash!.hasPrefix(prefix) {       autoreleasepool {         transaction.nonce += 1         hash = calculateHash(transaction)       }     }