correct timestamp if zero

devel
moneroexamples 5 years ago
parent 1e6c13f9cf
commit 370f28b02e

@ -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",

@ -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

@ -2159,7 +2159,8 @@ 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
@ -2167,14 +2168,14 @@ OpenMoneroRequests::create_account(
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

Loading…
Cancel
Save