diff --git a/html/css_2/moncrypt.webflow.css b/html/css_2/moncrypt.webflow.css index a6a1e5c..c1276da 100755 --- a/html/css_2/moncrypt.webflow.css +++ b/html/css_2/moncrypt.webflow.css @@ -789,9 +789,10 @@ p { color: #68717a; } .transaction-address { - font-family: Proximanova, sans-serif; + /*font-family: Proximanova, sans-serif;*/ + font-family: Andale Mono, monospace; color: #6d7d8c; - font-size: 12px; + font-size: 10px; font-weight: 400; } .transaction-address.transaction-page { @@ -799,9 +800,10 @@ p { color: #5a6a6e; } .transaction-detail { - font-family: Proximanova, sans-serif; + /*font-family: Proximanova, sans-serif;*/ + font-family: Andale Mono, monospace; color: #6d7d8c; - font-size: 13px; + font-size: 10px; } .transaction-detail.transaction-left { padding-left: 15px; @@ -820,8 +822,8 @@ p { padding-bottom: 10px; } .received-div.transaction-body.lighter { - padding-top: 12px; - padding-bottom: 12px; + padding-top: 10px; + padding-bottom: 10px; border-right: 1px solid #d3e1ed; border-left: 1px solid #d3e1ed; background-color: #edf5fc; diff --git a/html/js/cn_util.js b/html/js/cn_util.js index 2434e09..c88851e 100644 --- a/html/js/cn_util.js +++ b/html/js/cn_util.js @@ -461,7 +461,7 @@ var cnUtil = (function(initConfig) { first = seed; //only input reduced seeds or this will not give you the result you want } keys.spend = this.generate_keys(first); - var second = this.cn_fast_hash(first); + var second = this.cn_fast_hash(keys.spend.sec); keys.view = this.generate_keys(second); keys.public_addr = this.pubkeys_to_string(keys.spend.pub, keys.view.pub); return keys; @@ -2007,7 +2007,8 @@ var cnUtil = (function(initConfig) { return "Transaction is unlocked"; } var unlock_prediction = moment().add(numBlocks * config.avgBlockTime, 'seconds'); - return "Will be unlocked in " + numBlocks + " blocks, ~" + unlock_prediction.fromNow(true) + ", " + unlock_prediction.calendar() + ""; + //return "Will be unlocked in " + numBlocks + " blocks, ~" + unlock_prediction.fromNow(true) + ", " + unlock_prediction.calendar() + ""; + return "Will be unlocked in " + numBlocks + " blocks, ~" + unlock_prediction.fromNow(true); } else { // unlock time is timestamp var current_time = Math.round(new Date().getTime() / 1000); @@ -2016,7 +2017,8 @@ var cnUtil = (function(initConfig) { return "Transaction is unlocked"; } var unlock_moment = moment(unlock_time * 1000); - return "Will be unlocked " + unlock_moment.fromNow() + ", " + unlock_moment.calendar(); + //return "Will be unlocked " + unlock_moment.fromNow() + ", " + unlock_moment.calendar(); + return "Will be unlocked " + unlock_moment.fromNow(); } }; diff --git a/html/js/controllers/generate_wallet.js b/html/js/controllers/generate_wallet.js index a9a9ce7..9bfb0cc 100755 --- a/html/js/controllers/generate_wallet.js +++ b/html/js/controllers/generate_wallet.js @@ -28,10 +28,13 @@ thinwalletCtrls.controller('GenerateWalletCtrl', function ($scope, $location, AccountService) { "use strict"; + $scope.seed = ''; $scope.mnemonic = ''; $scope.mnemonic_confirmation = ''; $scope.error = ''; + $scope.testnet = config.testnet; + $scope.$watch('seed', function () { $scope.mnemonic = mn_encode($scope.seed); $scope.keys = cnUtil.create_address($scope.seed); diff --git a/html/modals/review-account-details.html b/html/modals/review-account-details.html index e218aa3..f95d62a 100755 --- a/html/modals/review-account-details.html +++ b/html/modals/review-account-details.html @@ -8,6 +8,10 @@
+ +
+
{{mnemonic}}
+
{{address}}
@@ -20,6 +24,20 @@
{{spend_key}}
+ +
+
+ monero-wallet-cli {{testnet ? "--testnet" : "" }} --restore-deterministic-wallet and follow the prompts +
note: monero-wallet-cli in Windows is monero-wallet-cli.exe +
+
+ +
+
+ monero-wallet-cli {{testnet ? "--testnet" : "" }} --generate-from-keys your_new_wallets_name and follow the prompts +
note: monero-wallet-cli in Windows is monero-wallet-cli.exe +
+
diff --git a/html/partials/account-overview.html b/html/partials/account-overview.html index 8b35737..e73939f 100755 --- a/html/partials/account-overview.html +++ b/html/partials/account-overview.html @@ -88,7 +88,7 @@
-
+
{{tx_locked_reason(tx)}}
diff --git a/html/partials/account-transactions.html b/html/partials/account-transactions.html index bf2ac6e..ba482b6 100755 --- a/html/partials/account-transactions.html +++ b/html/partials/account-transactions.html @@ -104,7 +104,7 @@
-
+
{{tx_locked_reason(tx)}}
diff --git a/src/CurrentBlockchainStatus.cpp b/src/CurrentBlockchainStatus.cpp index 31fff9d..6ef83fe 100644 --- a/src/CurrentBlockchainStatus.cpp +++ b/src/CurrentBlockchainStatus.cpp @@ -138,18 +138,54 @@ CurrentBlockchainStatus::init_monero_blockchain() bool -CurrentBlockchainStatus::is_tx_unlocked(uint64_t tx_blk_height, bool is_coinbase) +CurrentBlockchainStatus::is_tx_unlocked( + uint64_t unlock_time, + uint64_t block_height) { - if (!is_coinbase) + if(!is_tx_spendtime_unlocked(unlock_time, block_height)) + return false; + + if(block_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE > current_height + 1) + return false; + + return true; +} + + +bool +CurrentBlockchainStatus::is_tx_spendtime_unlocked( + uint64_t unlock_time, + uint64_t block_height) +{ + if(unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER) { - return (tx_blk_height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE <= get_current_blockchain_height()); + //interpret as block index + if(current_height + CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS >= unlock_time) + return true; + else + return false; } else { - return (tx_blk_height + CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW <= get_current_blockchain_height()); + //interpret as time + uint64_t current_time = static_cast(time(NULL)); + // XXX: this needs to be fast, so we'd need to get the starting heights + // from the daemon to be correct once voting kicks in + + uint64_t v2height = testnet ? 624634 : 1009827; + + uint64_t leeway = block_height < v2height + ? CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1 + : CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2; + + if(current_time + leeway >= unlock_time) + return true; + else + return false; } -} + return false; +} bool CurrentBlockchainStatus::get_block(uint64_t height, block &blk) diff --git a/src/CurrentBlockchainStatus.h b/src/CurrentBlockchainStatus.h index d83c177..72c524b 100644 --- a/src/CurrentBlockchainStatus.h +++ b/src/CurrentBlockchainStatus.h @@ -91,7 +91,10 @@ struct CurrentBlockchainStatus init_monero_blockchain(); static bool - is_tx_unlocked(uint64_t tx_blk_height, bool is_coinbase); + is_tx_unlocked(uint64_t unlock_time, uint64_t block_height); + + static bool + is_tx_spendtime_unlocked(uint64_t unlock_time, uint64_t block_height); static bool get_block(uint64_t height, block &blk); diff --git a/src/MySqlAccounts.cpp b/src/MySqlAccounts.cpp index 8199afc..9896d83 100644 --- a/src/MySqlAccounts.cpp +++ b/src/MySqlAccounts.cpp @@ -832,7 +832,8 @@ MySqlAccounts::select_txs_for_account_spendability_check( if (bool {tx.spendable} == false) { - if (CurrentBlockchainStatus::is_tx_unlocked(tx.height, tx.coinbase)) + + if (CurrentBlockchainStatus::is_tx_unlocked(tx.unlock_time, tx.height)) { // this tx was before marked as unspendable, but now @@ -875,6 +876,17 @@ MySqlAccounts::select_txs_for_account_spendability_check( continue; } + // set unlock_time field so that frontend displies it + // as a locked tx, if unlock_time is zero. + // coinbtase txs have this set already. regular tx + // have unlock_time set to zero by default, but they cant + // be spent anyway. + + if (tx.unlock_time == 0) + { + tx.unlock_time = tx.height + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE; + } + } // else } // if (bool {tx.spendable} == false) diff --git a/src/TxSearch.cpp b/src/TxSearch.cpp index 5034a1d..603e4b8 100644 --- a/src/TxSearch.cpp +++ b/src/TxSearch.cpp @@ -161,8 +161,9 @@ TxSearch::search() // flag indicating whether the txs in the given block are spendable. // this is true when block number is more than 10 blocks from current // blockchain height. + bool is_spendable = CurrentBlockchainStatus::is_tx_unlocked( - searched_blk_no, oi_identification.tx_is_coinbase); + tx.unlock_time, searched_blk_no); // FIRSt step. oi_identification.identify_outputs(); @@ -201,9 +202,7 @@ TxSearch::search() // for regular tx, the unlock time is // default of 10 blocks. // for coinbase tx it is 60 blocks - tx_data.unlock_time = (oi_identification.tx_is_coinbase ? - searched_blk_no + CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW - : searched_blk_no + CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE); + tx_data.unlock_time = tx.unlock_time; tx_data.height = searched_blk_no; tx_data.coinbase = oi_identification.tx_is_coinbase; @@ -362,9 +361,7 @@ TxSearch::search() tx_data.account_id = acc->id; tx_data.total_received = 0; // because this is spending, total_recieved is 0 tx_data.total_sent = total_sent; - tx_data.unlock_time = 0; // spend only tx dont have unlock time - // sicne we are not recieving any outputs - // that we can spend + tx_data.unlock_time = tx.unlock_time; tx_data.height = searched_blk_no; tx_data.coinbase = oi_identification.tx_is_coinbase; tx_data.is_rct = oi_identification.is_rct; diff --git a/src/YourMoneroRequests.cpp b/src/YourMoneroRequests.cpp index ddd72b7..5e2082e 100644 --- a/src/YourMoneroRequests.cpp +++ b/src/YourMoneroRequests.cpp @@ -440,9 +440,7 @@ YourMoneroRequests::get_unspent_outs(const shared_ptr< Session > session, const // thus no reason to return them to the frontend // for constructing a tx. - int64_t time_since_unlock = current_blockchain_height - tx.unlock_time; - - if (!CurrentBlockchainStatus::is_tx_unlocked(tx.height, tx.coinbase)) + if (!CurrentBlockchainStatus::is_tx_unlocked(tx.unlock_time, tx.height)) { continue; }