What time do you mean? The server time, on which the nxt client is running?
Time of the machine NRS server part runs on.
It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
Transaction transaction = new Transaction(Transaction.TYPE_PAYMENT, Transaction.SUBTYPE_PAYMENT_ORDINARY_PAYMENT, getEpochTime(System.currentTimeMillis()), deadline, publicKey, recipient, amount, fee, referencedTransaction, new byte[64]);
transaction.sign(secretPhrase);
JSONObject peerRequest = new JSONObject();
peerRequest.put("requestType", "processTransactions");
JSONArray transactionsData = new JSONArray();
transactionsData.add(transaction.getJSONObject());
peerRequest.put("transactions", transactionsData);
Peer.sendToAllPeers(peerRequest);
response.put("transaction", convert(transaction.getId()));
response.put("bytes", convert(transaction.getBytes()));
Transaction transaction = new Transaction(Transaction.TYPE_PAYMENT, Transaction.SUBTYPE_PAYMENT_ORDINARY_PAYMENT, getEpochTime(System.currentTimeMillis()), deadline, publicKey, recipient, amount, fee, referencedTransaction, new byte[64]);
transaction.sign(secretPhrase);
JSONObject peerRequest = new JSONObject();
peerRequest.put("requestType", "processTransactions");
JSONArray transactionsData = new JSONArray();
transactionsData.add(transaction.getJSONObject());
peerRequest.put("transactions", transactionsData);
Peer.sendToAllPeers(peerRequest);
response.put("transaction", convert(transaction.getId()));
response.put("bytes", convert(transaction.getBytes()));
All 256 bits r checked after the very 1st outgoing transaction is made.
All 256 bits r checked after the very 1st outgoing transaction is made.
1. They'll be unblacklisted after a short period of time.
2. They can't do that without providing valid blocks or being blacklisted.
scheduledThreadPool.shutdown();
try {
scheduledThreadPool.awaitTermination(10, TimeUnit.SECONDS);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (! scheduledThreadPool.isTerminated()) {
logMessage("some threads didn't terminate, forcing shutdown");
scheduledThreadPool.shutdownNow();
}
try {
Block.saveBlocks("blocks.nxt", true);
} catch (Exception e) {
logMessage("error saving blocks.nxt");
}
try {
Transaction.saveTransactions("transactions.nxt");
} catch (Exception e) {
logMessage("error saving transactions.nxt");
}
logMessage("Nxt stopped.");
synchronized (Nxt.transactions) {
// if not breaking any logic, loop that contains removing, is better start from end
// Not sure about Java and this code, but some programs may get critical problems, if removing causes kind of skipping over every second item.
for (int i = block.numberOfTransactions - 1; i >= 0 ; i--) {
//for (int i = 0; i < block.numberOfTransactions; i++) {
Transaction transaction = Nxt.transactions.remove(block.transactions[i]);
unconfirmedTransactions.put(block.transactions[i], transaction);
Account senderAccount = accounts.get(Account.getId(transaction.senderPublicKey));
// check if null?
synchronized (senderAccount) {
senderAccount.setBalance(senderAccount.balance + (transaction.amount + transaction.fee) * 100L);
}
----------------------------
----------------
block.blockSignature = Crypto.sign(data2, secretPhrase);
// inside if block: JSONObject request = block.getJSONObject(newTransactions);
// request.put("requestType", "processBlock");
// similarly could be eg. in " case "sendMoney": ", etc.
if (block.verifyBlockSignature() && block.verifyGenerationSignature()) {
JSONObject request = block.getJSONObject(newTransactions); // moved here
request.put("requestType", "processBlock");
Peer.sendToAllPeers(request);
} else {
--------------------
synchronized (Nxt.transactions) {
for (int i = 0; i < numberOfTransactions; i++) {
Transaction transaction = Nxt.transactions.get(transactions[i]);
long sender = Account.getId(transaction.senderPublicKey);
Account senderAccount = accounts.get(sender);
// check if (senderAccount == null) {
synchronized (senderAccount) {
-------------------
long twofoldCurBaseTarget = curBaseTarget * 2;
if (twofoldCurBaseTarget < 0) {
// also this? twofoldCurBaseTarget > maxBaseTarget
twofoldCurBaseTarget = maxBaseTarget;
}
if (newBaseTarget > twofoldCurBaseTarget) {
------------------
byte[] getBytes() {
ByteBuffer buffer = ByteBuffer.allocate(4 + 4 + 8 + 4 + 4 + 4 + 4 + 32 + 32 + 64 + 64);
// Did Java take care about low memory or allocation errors? No need to check ?
------------
Account account = accounts.get(Account.getId(generatorPublicKey));
if (account == null || account.getEffectiveBalance() == 0) {
return false;
}
int elapsedTime = timestamp - previousBlock.timestamp;
// does target get here random numbers? Any test results of N*1000 run cases?
BigInteger target = BigInteger.valueOf(Block.getBaseTarget()).multiply(BigInteger.valueOf(account.getEffectiveBalance())).multiply(BigInteger.valueOf(elapsedTime));
byte[] generationSignatureHash = MessageDigest.getInstance("SHA-256").digest(generationSignature);
--------------------------
int getWeight() {
// ...
// if balance < 100, the result should be 0?
return (int)(adjustedWeight * (account.balance / 100) / 1000000000);
-------------------------
for (i = 0; i < numberOfBlocks; i++) {
JSONObject blockData = (JSONObject)nextBlocks.get(i);
Block block = Block.getBlock(blockData);
// if block is null ?
curBlockId = block.getId();
----------------------------
synchronized (blocks) {
long blockId = lastBlock;
int height = Block.getLastBlock().height;
int numberOfBlocks = 0;
while (numberOfBlocks < 60) {
// can height become negative in loop?
numberOfBlocks++;
Block block = blocks.get(blockId);
-----------------------------