Skip to content

Commit

Permalink
cli_wallet transaction_default_expiration as constant
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto-ape committed Jun 20, 2019
1 parent 35cf7d6 commit 3ee7209
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ class wallet_api_impl
public:
api_documentation method_documentation;
private:
const int64_t transaction_expiration_time_sec = 30;

void claim_registered_account(const account_object& account)
{
bool import_keys = false;
Expand Down Expand Up @@ -1142,7 +1144,7 @@ class wallet_api_impl

auto dyn_props = get_dynamic_global_properties();
tx.set_reference_block( dyn_props.head_block_id );
tx.set_expiration( dyn_props.time + fc::seconds(30) );
tx.set_expiration( dyn_props.time + fc::seconds(transaction_expiration_time_sec) );
tx.validate();

for( public_key_type& key : paying_keys )
Expand Down Expand Up @@ -1266,7 +1268,7 @@ class wallet_api_impl

auto dyn_props = get_dynamic_global_properties();
tx.set_reference_block( dyn_props.head_block_id );
tx.set_expiration( dyn_props.time + fc::seconds(30) );
tx.set_expiration( dyn_props.time + fc::seconds(transaction_expiration_time_sec) );
tx.validate();

for( public_key_type& key : paying_keys )
Expand Down Expand Up @@ -2174,7 +2176,7 @@ class wallet_api_impl
uint32_t expiration_time_offset = 0;
for (;;)
{
tx.set_expiration( dyn_props.time + fc::seconds(30 + expiration_time_offset) );
tx.set_expiration( dyn_props.time + fc::seconds(transaction_expiration_time_sec + expiration_time_offset) );
tx.clear_signatures();

for( const public_key_type& key : approving_key_set )
Expand Down

0 comments on commit 3ee7209

Please sign in to comment.