mirror of
https://github.com/creating2morrow/neveko.git
synced 2025-01-03 09:29:39 +00:00
fix wallet race on consecutive prove retry validations
This commit is contained in:
parent
a02702a32e
commit
debdc2065b
13 changed files with 23 additions and 18 deletions
|
@ -34,6 +34,12 @@ NEVidebla-EKOnomia (invisible economy)
|
||||||
* ` ./scripts/build_all_and_run.sh "-- --monero-blockchain-dir=/home/user/.bitmonero --monero-location /home/user/monero-x86_64-linux-gnu-v0.18.2.2 --i2p-zero-dir /home/user/i2p-zero-linux.v1.21/ --monero-blockchain-dir /home/user/.bitmonero"`
|
* ` ./scripts/build_all_and_run.sh "-- --monero-blockchain-dir=/home/user/.bitmonero --monero-location /home/user/monero-x86_64-linux-gnu-v0.18.2.2 --i2p-zero-dir /home/user/i2p-zero-linux.v1.21/ --monero-blockchain-dir /home/user/.bitmonero"`
|
||||||
* monerod doesn't need to be running because neveko will start it and monero-wallet-rpc
|
* monerod doesn't need to be running because neveko will start it and monero-wallet-rpc
|
||||||
* gui will automatically detect monerod, rpc and i2p-zero if neveko core is started first
|
* gui will automatically detect monerod, rpc and i2p-zero if neveko core is started first
|
||||||
|
* Neveko doesn't write logs to file. Use the command below to write to a log file:
|
||||||
|
```bash
|
||||||
|
{NEVEKO_START_CMDS} > neveko.log 2>&1
|
||||||
|
```
|
||||||
|
* just remember to put cli password in the original window, not the log file window
|
||||||
|
* https://stackoverflow.com/questions/6674327/redirect-all-output-to-file-in-bash
|
||||||
* gui built with rust [egui](https://docs.rs/egui/latest/egui/)
|
* gui built with rust [egui](https://docs.rs/egui/latest/egui/)
|
||||||
|
|
||||||
## Installation Mananger
|
## Installation Mananger
|
||||||
|
|
|
@ -5,15 +5,15 @@ Hash: SHA512
|
||||||
I am the admin of http://c2m66oddrzozztxyzjegbdwtgbeiibq5vz2tpchmqamrzcahcfoq.b32.i2p.
|
I am the admin of http://c2m66oddrzozztxyzjegbdwtgbeiibq5vz2tpchmqamrzcahcfoq.b32.i2p.
|
||||||
I am in control of my PGP key.
|
I am in control of my PGP key.
|
||||||
I will update this canary within 14 days.
|
I will update this canary within 14 days.
|
||||||
Today is Mon Jun 26 02:35:13 AM UTC 2023.
|
Today is Mon Jul 10 05:16:42 PM UTC 2023.
|
||||||
|
|
||||||
Latest monero block hash (2916237):
|
Latest monero block hash (2926791):
|
||||||
761a51317fc1ae508eab3b0990916f405d7426466485499f9ba851986b558e71
|
20932190c77951183c0b085bdfc64e4bdc7150e7d625b0c6ec46c06c9ef226e8
|
||||||
-----BEGIN PGP SIGNATURE-----
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
iJIEARYKADoWIQQEoRcoLQbE3ctKJgFaPK5QG49jTAUCZJj5YRwcY3JlYXRpbmdf
|
iJIEARYKADoWIQQEoRcoLQbE3ctKJgFaPK5QG49jTAUCZKw8+hwcY3JlYXRpbmdf
|
||||||
dG9tb3Jyb3dAcHJvdG9uLm1lAAoJEFo8rlAbj2NMHXsBAPWKWEfJoDtUxAPJwjLk
|
dG9tb3Jyb3dAcHJvdG9uLm1lAAoJEFo8rlAbj2NMeZkA/j8ifcKtkeHE7mFu3k54
|
||||||
vC4WkUc7kLpEjHihXFkRpR47AP4ptWVnXyt0cpEh1j12/U7QM/rDRUyD2o6Wc3/A
|
ltxRec2FFhpT/M6X7ClXzsn6AP9Y2VBYK7ChQ34NCrskAxWP9uC/mwv481Oy0d4C
|
||||||
kQsmDA==
|
RyNWAw==
|
||||||
=HPZW
|
=g/0B
|
||||||
-----END PGP SIGNATURE-----
|
-----END PGP SIGNATURE-----
|
||||||
|
|
|
@ -18,8 +18,6 @@ use std::{
|
||||||
// TODO(c2m): remove this module and use monero public keys for text encryption
|
// TODO(c2m): remove this module and use monero public keys for text encryption
|
||||||
|
|
||||||
/// Searches for key, returns empty string if none exists
|
/// Searches for key, returns empty string if none exists
|
||||||
///
|
|
||||||
/// TODO(c2m): add more cli options
|
|
||||||
pub fn find_key() -> Result<String, Box<dyn Error>> {
|
pub fn find_key() -> Result<String, Box<dyn Error>> {
|
||||||
info!("searching for application gpg key");
|
info!("searching for application gpg key");
|
||||||
let proto = Protocol::OpenPgp;
|
let proto = Protocol::OpenPgp;
|
||||||
|
|
|
@ -488,6 +488,8 @@ fn update_wallet_lock(filename: &String, closing: bool) -> bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(c2m): search the app and use this output to either bail (false) or continue (true)
|
||||||
|
|
||||||
/// Performs the xmr rpc 'open_wallet' method
|
/// Performs the xmr rpc 'open_wallet' method
|
||||||
pub async fn open_wallet(filename: &String, password: &String) -> bool {
|
pub async fn open_wallet(filename: &String, password: &String) -> bool {
|
||||||
let updated = update_wallet_lock(filename, false);
|
let updated = update_wallet_lock(filename, false);
|
||||||
|
|
|
@ -258,6 +258,7 @@ async fn validate_proof(txp: &TxProof) -> TxProof {
|
||||||
let tx_type = tx.result.transfer.r#type;
|
let tx_type = tx.result.transfer.r#type;
|
||||||
let propgated = monero::TransactionType::propagated(tx_type);
|
let propgated = monero::TransactionType::propagated(tx_type);
|
||||||
if !propgated {
|
if !propgated {
|
||||||
|
monero::close_wallet(&wallet_name, &wallet_password).await;
|
||||||
return Default::default();
|
return Default::default();
|
||||||
}
|
}
|
||||||
let p = monero::check_tx_proof(txp).await;
|
let p = monero::check_tx_proof(txp).await;
|
||||||
|
@ -268,6 +269,7 @@ async fn validate_proof(txp: &TxProof) -> TxProof {
|
||||||
&& p.result.confirmations < cth
|
&& p.result.confirmations < cth
|
||||||
&& p.result.received >= pth;
|
&& p.result.received >= pth;
|
||||||
if lgtm {
|
if lgtm {
|
||||||
|
monero::close_wallet(&wallet_name, &wallet_password).await;
|
||||||
return TxProof {
|
return TxProof {
|
||||||
subaddress: String::from(&txp.subaddress),
|
subaddress: String::from(&txp.subaddress),
|
||||||
hash: String::from(&txp.hash),
|
hash: String::from(&txp.hash),
|
||||||
|
|
|
@ -627,7 +627,7 @@ pub fn stage_cleanup(f: String) {
|
||||||
///
|
///
|
||||||
/// software on their own. Note that software pull is over
|
/// software on their own. Note that software pull is over
|
||||||
///
|
///
|
||||||
/// clearnet. TODO(c2m): trusted download locations over i2p.
|
/// clearnet. TODO(c2m): trusted download locations over tor.
|
||||||
pub async fn install_software(installations: Installations) -> bool {
|
pub async fn install_software(installations: Installations) -> bool {
|
||||||
let mut valid_i2p_zero_hash = true;
|
let mut valid_i2p_zero_hash = true;
|
||||||
let mut valid_xmr_hash = true;
|
let mut valid_xmr_hash = true;
|
||||||
|
|
|
@ -1035,7 +1035,7 @@ pub(crate) mod backend {
|
||||||
pub decorated: Option<bool>,
|
pub decorated: Option<bool>,
|
||||||
|
|
||||||
/// Set to some bool to change window fullscreen.
|
/// Set to some bool to change window fullscreen.
|
||||||
#[cfg(not(target_arch = "wasm32"))] // TODO(c2m): implement fullscreen on web
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
pub fullscreen: Option<bool>,
|
pub fullscreen: Option<bool>,
|
||||||
|
|
||||||
/// Set to true to drag window while primary mouse button is down.
|
/// Set to true to drag window while primary mouse button is down.
|
||||||
|
|
|
@ -1743,7 +1743,6 @@ impl Context {
|
||||||
/// The `Context` lock is held while the given closure is called!
|
/// The `Context` lock is held while the given closure is called!
|
||||||
///
|
///
|
||||||
/// Returns `None` if acesskit is off.
|
/// Returns `None` if acesskit is off.
|
||||||
// TODO(c2m): consider making both RO and RW versions
|
|
||||||
#[cfg(feature = "accesskit")]
|
#[cfg(feature = "accesskit")]
|
||||||
pub fn accesskit_node_builder<R>(
|
pub fn accesskit_node_builder<R>(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -154,7 +154,7 @@ impl Default for Orientation {
|
||||||
pub enum PlotPoints {
|
pub enum PlotPoints {
|
||||||
Owned(Vec<PlotPoint>),
|
Owned(Vec<PlotPoint>),
|
||||||
Generator(ExplicitGenerator),
|
Generator(ExplicitGenerator),
|
||||||
// Borrowed(&[PlotPoint]), // TODO(c2m): Lifetimes are tricky in this case.
|
// Borrowed(&[PlotPoint]),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for PlotPoints {
|
impl Default for PlotPoints {
|
||||||
|
|
|
@ -660,7 +660,7 @@ impl<'t> TextEdit<'t> {
|
||||||
&cursor_range.primary,
|
&cursor_range.primary,
|
||||||
);
|
);
|
||||||
|
|
||||||
let is_fully_visible = ui.clip_rect().contains_rect(rect); // TODO(c2m): remove this HACK workaround for https://github.com/emilk/egui/issues/1531
|
let is_fully_visible = ui.clip_rect().contains_rect(rect);
|
||||||
if (response.changed || selection_changed) && !is_fully_visible {
|
if (response.changed || selection_changed) && !is_fully_visible {
|
||||||
ui.scroll_to_rect(cursor_pos, None); // keep cursor in view
|
ui.scroll_to_rect(cursor_pos, None); // keep cursor in view
|
||||||
}
|
}
|
||||||
|
|
|
@ -798,7 +798,6 @@ fn is_kana(c: char) -> bool {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn is_cjk(c: char) -> bool {
|
fn is_cjk(c: char) -> bool {
|
||||||
// TODO(c2m): Add support for Korean Hangul.
|
|
||||||
is_cjk_ideograph(c) || is_kana(c)
|
is_cjk_ideograph(c) || is_kana(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -773,8 +773,6 @@ fn send_payment_req(
|
||||||
String::from(&contact),
|
String::from(&contact),
|
||||||
format!("{}", unix),
|
format!("{}", unix),
|
||||||
);
|
);
|
||||||
// TODO(c2m): edge case when proving payment fails to complete
|
|
||||||
// case the payment proof data and set retry logic
|
|
||||||
ctx.request_repaint();
|
ctx.request_repaint();
|
||||||
}
|
}
|
||||||
_ => log::error!("failed to obtain jwp"),
|
_ => log::error!("failed to obtain jwp"),
|
||||||
|
|
|
@ -29,6 +29,7 @@ impl eframe::App for SettingsApp {
|
||||||
"____________________________________________________________________________\n",
|
"____________________________________________________________________________\n",
|
||||||
);
|
);
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
|
// TODO(c2m): call monero-wallet-rpc to update as well
|
||||||
let sweep_label = ui.label("new credential: \t");
|
let sweep_label = ui.label("new credential: \t");
|
||||||
ui.text_edit_singleline(&mut self.credential)
|
ui.text_edit_singleline(&mut self.credential)
|
||||||
.labelled_by(sweep_label.id);
|
.labelled_by(sweep_label.id);
|
||||||
|
|
Loading…
Reference in a new issue