Skip to content

Commit

Permalink
update sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jan 15, 2021
1 parent f110065 commit a4a0783
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ struct : monero_wallet_listener {
bool is_locked = dynamic_pointer_cast<monero_tx_wallet>(output.m_tx)->m_is_locked.get();
int account_index = output.m_account_index.get();
int subaddress_index = output.m_subaddress_index.get();
OUTPUT_RECEIVED = true;
FUNDS_RECEIVED = true;
}
} my_listener;
wallet_random->add_listener(my_listener);
Expand All @@ -119,7 +119,7 @@ struct : monero_wallet_listener {
string tx_hash = output.m_tx->m_hash.get();
int account_index = output.m_account_index.get();
int subaddress_index = output.m_subaddress_index.get();
OUTPUT_RECEIVED = true;
FUNDS_RECEIVED = true;
}
} my_listener;
wallet_random->add_listener(my_listener);
Expand Down
6 changes: 3 additions & 3 deletions test/sample_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using namespace std;

bool OUTPUT_RECEIVED = false;
bool FUNDS_RECEIVED = false;

/**
* This code introduces the API.
Expand Down Expand Up @@ -103,7 +103,7 @@ int main(int argc, const char* argv[]) {
bool is_locked = static_pointer_cast<monero_tx_wallet>(output.m_tx)->m_is_locked.get();
int account_index = output.m_account_index.get();
int subaddress_index = output.m_subaddress_index.get();
OUTPUT_RECEIVED = true;
FUNDS_RECEIVED = true;
}
} my_listener;
wallet_random->add_listener(my_listener);
Expand Down Expand Up @@ -148,7 +148,7 @@ int main(int argc, const char* argv[]) {
wallet_restored->relay_tx(*created_tx); // recipient receives notification within 5 seconds

// the recipient wallet will be notified
if (OUTPUT_RECEIVED) cout << "Sample code completed successfully" << endl;
if (FUNDS_RECEIVED) cout << "Sample code completed successfully" << endl;
else throw runtime_error("Output should have been received");

// save and close the wallets
Expand Down

0 comments on commit a4a0783

Please sign in to comment.