Skip to content

Commit

Permalink
fix: update console wallet on one sided payment import (#2983)
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler committed Jun 4, 2021
2 parents f7dc3a4 + 5c13deb commit f45cdc4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl WalletEventMonitor {
TransactionEvent::ReceivedTransaction(tx_id) |
TransactionEvent::ReceivedTransactionReply(tx_id) |
TransactionEvent::TransactionBroadcast(tx_id) |
TransactionEvent::TransactionMinedRequestTimedOut(tx_id) => {
TransactionEvent::TransactionMinedRequestTimedOut(tx_id) | TransactionEvent::TransactionImported(tx_id) => {
self.trigger_tx_state_refresh(tx_id).await;
},
TransactionEvent::TransactionDirectSendResult(tx_id, true) |
Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/blocks/genesis_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub fn get_weatherwax_genesis_block_raw() -> Block {
prev_hash: vec![
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
],
timestamp: 1_620_120_256.into(), // 04/05/2021 @ 09:24:16 (UTC)
timestamp: 1_622_550_256.into(),
output_mr: from_hex("dcc44f39b65e5e1e526887e7d56f7b85e2ea44bd29bc5bc195e6e015d19e1c06").unwrap(),
range_proof_mr: from_hex("e4d7dab49a66358379a901b9a36c10f070aa9d7bdc8ae752947b6fc4e55d255f").unwrap(),
output_mmr_size: 1,
Expand Down
1 change: 1 addition & 0 deletions base_layer/wallet/src/transaction_service/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ pub enum TransactionEvent {
TransactionStoreForwardSendResult(TxId, bool),
TransactionCancelled(TxId),
TransactionBroadcast(TxId),
TransactionImported(TxId),
TransactionMined(TxId),
TransactionMinedRequestTimedOut(TxId),
TransactionMinedUnconfirmed(TxId, u64),
Expand Down
11 changes: 11 additions & 0 deletions base_layer/wallet/src/transaction_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1663,6 +1663,17 @@ where
maturity,
)
.await?;
let _ = self
.event_publisher
.send(Arc::new(TransactionEvent::TransactionImported(tx_id)))
.map_err(|e| {
trace!(
target: LOG_TARGET,
"Error sending event, usually because there are no subscribers: {:?}",
e
);
e
});
Ok(tx_id)
}

Expand Down
2 changes: 2 additions & 0 deletions common/config/presets/tari_config_example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ base_node_query_timeout = 120
# (options: "DirectOnly", "StoreAndForwardOnly", DirectAndStoreAndForward". default: "DirectAndStoreAndForward").
#transaction_routing_mechanism = "DirectAndStoreAndForward"

scan_for_utxo_interval=60

# When running the console wallet in command mode, use these values to determine what "stage" and timeout to wait
# for sent transactions.
# The stages are:
Expand Down

0 comments on commit f45cdc4

Please sign in to comment.