Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
correct timestamp if zero
Browse files Browse the repository at this point in the history
  • Loading branch information
moneroexamples committed Aug 15, 2019
1 parent 1e6c13f commit 370f28b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"wallet_import" :
{
"_comment": "if fee is 0, then importing is free. fee is in base 1e12, e.g., 0.1 xmr is 0.1 x 1e12 = 100000000000",
"fee" : 0,
"fee" : 100000000000,
"testnet" :
{
"address" : "9tzmPMTViHYM3z6NAgQni1Qm1Emzxy5hQFibPgWD3LVTAz91yok5Eni1pH6zKhBHzpTU15GZooPHSGHXFvFuXEdmEG2sWAZ",
Expand Down
2 changes: 1 addition & 1 deletion html/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var config = {
mainnetExplorerUrl: "https://xmrchain.com/",
testnetExplorerUrl: "https://testnet.xmrchain.com/",
stagenetExplorerUrl: "http://139.162.60.17:8082/",
nettype: 2, /* 0 - MAINNET, 1 - TESTNET, 2 - STAGENET */
nettype: 0, /* 0 - MAINNET, 1 - TESTNET, 2 - STAGENET */
coinUnitPlaces: 12,
txMinConfirms: 10, // corresponds to CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE in Monero
txCoinbaseMinConfirms: 60, // corresponds to CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW in Monero
Expand Down
7 changes: 4 additions & 3 deletions src/OpenMoneroRequests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2159,22 +2159,23 @@ OpenMoneroRequests::create_account(
// in a moment we will try to get last block timestamp
// to replace this value. But if it fails, we just use current
// timestamp
uint64_t current_blockchain_timestamp = std::time(nullptr);
uint64_t current_blockchain_timestamp
= std::time(nullptr);

// get last block so we have its timestamp when
// createing the account
block last_blk;

if (current_bc_status->get_block(current_blockchain_height, last_blk))
{
current_blockchain_timestamp = last_blk.timestamp;
if (last_blk.timestamp != 0)
current_blockchain_timestamp = last_blk.timestamp;
}

DateTime blk_timestamp_mysql_format
= XmrTransaction::timestamp_to_DateTime(
current_blockchain_timestamp);


//@todo setting up start_height and scanned_block_height
//needs to be revisited as they are needed for importing
//wallets. The simples way is when import is free and this
Expand Down

0 comments on commit 370f28b

Please sign in to comment.