remove offline decoding of seed (not used anyway)

pull/88/head
moneroexamples 6 years ago
parent 2da6ad9e0d
commit fef5f019a3

@ -14,17 +14,16 @@ to use, host and modify. Additionally, some features were added/changed as compa
to MyMonero. They include: to MyMonero. They include:
- google analytics, cloudflare, images and flash were removed. - google analytics, cloudflare, images and flash were removed.
- frontend's html and javascript upgrads and cleanups. - frontend's html and javascript upgrades and cleanups.
- transaction service fee was set to zero (same as in MyMonero). - transaction service fee was set to zero (same as in MyMonero).
- the wallets generated use 25 word mnemonics, fully compatible with official monero wallets - the wallets generated use 25 word mnemonics, fully compatible with official monero wallets
(13 word mnemonics generated by MyMonero work as usual though). (13 word mnemonics generated by MyMonero work as usual though).
- import wallet fee was reduced. - import wallet fee was reduced.
- added support of testnet and stagenet networks, and mainnet without relying transactions - added support of testnet and stagenet networks, and mainnet without relying transactions
- improved handling of mempool, coinbase, locked and unlocked transactions. - improved handling of mempool, coinbase, locked and unlocked transactions.
- added dynamic miner fees.
- view only mode added. - view only mode added.
- private tx key given to a user which can be used to prove sending xmr to a recipient. - private tx key given to a user which can be used to prove sending xmr to a recipient.
- Cross-Origin Resource Sharing (CORS) was disabled. - Cross-Origin Resource Sharing (CORS) disabled.
- transaction confirmation window added to double check tx details before its commited. - transaction confirmation window added to double check tx details before its commited.
- ability to select transaction priority. - ability to select transaction priority.
- legacy address + payment_id system replaced with integrated addresses for better privacy. - legacy address + payment_id system replaced with integrated addresses for better privacy.

@ -3,7 +3,7 @@ var config = {
mainnetExplorerUrl: "https://xmrchain.com/", mainnetExplorerUrl: "https://xmrchain.com/",
testnetExplorerUrl: "https://testnet.xmrchain.com/", testnetExplorerUrl: "https://testnet.xmrchain.com/",
stagenetExplorerUrl: "http://162.210.173.150:8083/", stagenetExplorerUrl: "http://162.210.173.150:8083/",
nettype: 2, /* 0 - MAINNET, 1 - TESTNET, 2 - STAGENET */ nettype: 1, /* 0 - MAINNET, 1 - TESTNET, 2 - STAGENET */
coinUnitPlaces: 12, coinUnitPlaces: 12,
txMinConfirms: 10, // corresponds to CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE in Monero txMinConfirms: 10, // corresponds to CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE in Monero
txCoinbaseMinConfirms: 60, // corresponds to CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW in Monero txCoinbaseMinConfirms: 60, // corresponds to CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW in Monero

@ -35,7 +35,7 @@ thinwalletCtrls.controller("LoginCtrl", function($scope, $location, AccountServi
$scope.error = ''; $scope.error = '';
}; };
$scope.decode = true; $scope.decode = false;
$scope.mnemonic_language = 'english'; $scope.mnemonic_language = 'english';
@ -46,7 +46,6 @@ thinwalletCtrls.controller("LoginCtrl", function($scope, $location, AccountServi
// just some dummy account, as not to fill login form every time. // just some dummy account, as not to fill login form every time.
$scope.mnemonic = "eluded extra boyfriend gels hiding waxing feline unbending drying pancakes dwindling fuming friendly pamphlet myth tepid snug budget android vogue losing each affair afraid affair"; $scope.mnemonic = "eluded extra boyfriend gels hiding waxing feline unbending drying pancakes dwindling fuming friendly pamphlet myth tepid snug budget android vogue losing each affair afraid affair";
} else { } else {
$scope.decode = false;
$scope.address = "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A"; $scope.address = "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A";
$scope.view_key = "f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501" ; $scope.view_key = "f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501" ;
} }
@ -81,8 +80,6 @@ thinwalletCtrls.controller("LoginCtrl", function($scope, $location, AccountServi
//var payment_id8 = rand_8(); //var payment_id8 = rand_8();
//var integarted_address = get_account_integrated_address(keys.public_addr, payment_id8); //var integarted_address = get_account_integrated_address(keys.public_addr, payment_id8);
$scope.decode = false;
return [seed, keys]; return [seed, keys];
}; };

@ -46,31 +46,6 @@
<input class="w-button login-btn pointer" id="form-submit" type="submit" value="Enter my account" <input class="w-button login-btn pointer" id="form-submit" type="submit" value="Enter my account"
data-wait="Please wait..."> data-wait="Please wait...">
</div> </div>
<!--
<div class="subhead-text modal">
<a class="login-link" data-ix="close-overlay" href="" ng-click="decodeSeed(mnemonic, mnemonic_language)">Decode the login key (works offline)</a>
</div>
-->
<div class="w-form form-wrapper" ng-show="address && decode">
<form id="email-form" name="email-form" data-name="Email Form">
<label class="field-label review" for="Mnemonic-2">Account Address (Public)</label>
<div class="move-text-div">
<div class="review-text address">{{address}} </div>
</div>
<label class="field-label review" for="Mnemonic-2">View Key (Private)</label>
<div class="move-text-div">
<div class="review-text">{{view_key}} </div>
</div>
<label class="field-label review" for="Mnemonic-2">Spend Key (Private)</label>
<div class="move-text-div">
<div class="review-text">{{spend_key}} </div>
</div>
<div class="submit-div">
<a class="login-btn modals pointer" data-ix="close-review-details" hide-modal>Ok, thanks!</a>
</div>
</form>
</div>
<div class="w-form-fail error-backing" style="display: block;" ng-show="!!error"> <div class="w-form-fail error-backing" style="display: block;" ng-show="!!error">
<p>{{error}}</p> <p>{{error}}</p>

@ -130,7 +130,7 @@ CurrentBlockchainStatus::init_monero_blockchain()
mcore = unique_ptr<xmreg::MicroCore>(new xmreg::MicroCore{}); mcore = unique_ptr<xmreg::MicroCore>(new xmreg::MicroCore{});
// initialize the core using the blockchain path // initialize the core using the blockchain path
if (!mcore->init(blockchain_path)) if (!mcore->init(blockchain_path, net_type))
return false; return false;
// get the high level Blockchain object to interact // get the high level Blockchain object to interact

@ -5,16 +5,6 @@
#include "MicroCore.h" #include "MicroCore.h"
namespace
{
// NOTE: These values should match blockchain.cpp
// TODO: Refactor
const uint64_t mainnet_hard_fork_version_1_till = 1009826;
const uint64_t testnet_hard_fork_version_1_till = 624633;
}
namespace xmreg namespace xmreg
{ {
/** /**
@ -45,31 +35,20 @@ MicroCore::MicroCore():
* Initialize m_blockchain_storage with the BlockchainLMDB object. * Initialize m_blockchain_storage with the BlockchainLMDB object.
*/ */
bool bool
MicroCore::init(const string& _blockchain_path) MicroCore::init(const string& _blockchain_path, network_type nt)
{ {
int db_flags = 0; int db_flags = 0;
blockchain_path = _blockchain_path; blockchain_path = _blockchain_path;
//db_flags |= MDB_RDONLY; nettype = nt;
db_flags |= MDB_NOLOCK;
//db_flags |= MDB_SYNC;
// uint64_t DEFAULT_FLAGS = MDB_NOMETASYNC | MDB_NORDAHEAD;
//db_flags = DEFAULT_FLAGS; db_flags |= MDB_RDONLY;
db_flags |= MDB_NOLOCK;
HardFork* m_hardfork = nullptr;
BlockchainDB* db = nullptr; BlockchainDB* db = nullptr;
db = new BlockchainLMDB(); db = new BlockchainLMDB();
bool use_testnet {false};
uint64_t hard_fork_version_1_till = use_testnet ? testnet_hard_fork_version_1_till : mainnet_hard_fork_version_1_till;
m_hardfork = new HardFork(*db, 1, hard_fork_version_1_till);
try try
{ {
// try opening lmdb database files // try opening lmdb database files
@ -84,13 +63,11 @@ MicroCore::init(const string& _blockchain_path)
// check if the blockchain database // check if the blockchain database
// is successful opened // is successful opened
if(!db->is_open()) if(!db->is_open())
{
return false; return false;
}
// initialize Blockchain object to manage // initialize Blockchain object to manage
// the database. // the database.
return m_blockchain_storage.init(db, m_hardfork, network_type::MAINNET); return m_blockchain_storage.init(db, nettype);
} }
/** /**
@ -349,11 +326,12 @@ MicroCore::~MicroCore()
bool bool
init_blockchain(const string& path, init_blockchain(const string& path,
MicroCore& mcore, MicroCore& mcore,
Blockchain*& core_storage) Blockchain*& core_storage,
network_type nt)
{ {
// initialize the core using the blockchain path // initialize the core using the blockchain path
if (!mcore.init(path)) if (!mcore.init(path, nt))
{ {
cerr << "Error accessing blockchain." << endl; cerr << "Error accessing blockchain." << endl;
return false; return false;

@ -34,11 +34,13 @@ class MicroCore {
hw::device* m_device; hw::device* m_device;
network_type nettype;
public: public:
MicroCore(); MicroCore();
bool bool
init(const string& _blockchain_path); init(const string& _blockchain_path, network_type nt);
Blockchain& Blockchain&
get_core(); get_core();
@ -96,8 +98,8 @@ public:
bool bool
init_blockchain(const string& path, init_blockchain(const string& path,
MicroCore& mcore, MicroCore& mcore,
Blockchain*& core_storage); Blockchain*& core_storage,
network_type nt);
} }

Loading…
Cancel
Save