@@ -1423,7 +1423,7 @@ def export_account_state(self, account_state):
14231423 """
14241424 Make an account state presentable to external consumers
14251425 """
1426- return {
1426+ result = {
14271427 'address' : account_state ['address' ],
14281428 'type' : account_state ['type' ],
14291429 'credit_value' : '{}' .format (account_state ['credit_value' ]),
@@ -1433,6 +1433,7 @@ def export_account_state(self, account_state):
14331433 'vtxindex' : account_state ['vtxindex' ],
14341434 'txid' : account_state ['txid' ],
14351435 }
1436+ return result
14361437
14371438
14381439 def rpc_get_account_record (self , address , token_type , ** con_info ):
@@ -1451,11 +1452,17 @@ def rpc_get_account_record(self, address, token_type, **con_info):
14511452
14521453 db = get_db_state (self .working_dir )
14531454 account = db .get_account (address , token_type )
1455+ last_block = db .lastblock
14541456 db .close ()
14551457
14561458 if account is None :
14571459 return {'error' : 'No such account' , 'http_status' : 404 }
14581460
1461+ # if block height is after the migration export threshold, return a lock height that will force the wallet to error when sending a tx
1462+ if last_block >= virtualchain_hooks .IMPORT_HEIGHT :
1463+ print log .warning ('[v2-upgrade] Forcing lock_transfer_block_id to 9999999 to prevent wallet txs' )
1464+ account ['lock_transfer_block_id' ] = 9999999
1465+
14591466 state = self .export_account_state (account )
14601467 return self .success_response ({'account' : state })
14611468
0 commit comments