|
@@ -141,15 +141,16 @@ export const writeRaw = async (api: RippleAPI, data: Memo, from:
|
141
|
141
|
|
142
|
142
|
|
143
|
143
|
export const readRaw = async (api: RippleAPI, hash: string): Promise<Memo> => {
|
144
|
|
- let _api
|
145
|
|
- if(!api.isConnected()){
|
146
|
|
- _api = await cloneApi(api)
|
147
|
|
- }else{
|
148
|
|
- _api = api
|
|
144
|
+ while(!api.isConnected()){
|
|
145
|
+ try{
|
|
146
|
+ await api.connect()
|
|
147
|
+ }catch(e){
|
|
148
|
+ //retry
|
|
149
|
+ }
|
149
|
150
|
}
|
150
|
151
|
let tx
|
151
|
152
|
try{
|
152
|
|
- tx = await _api.getTransaction(hash, {
|
|
153
|
+ tx = await api.getTransaction(hash, {
|
153
|
154
|
minLedgerVersion: 25235454
|
154
|
155
|
})
|
155
|
156
|
}catch(e){
|
|
@@ -157,8 +158,6 @@ export const readRaw = async (api: RippleAPI, hash: string): Promise<Memo> => {
|
157
|
158
|
console.log("READRAW ERR", e)
|
158
|
159
|
throw e
|
159
|
160
|
}
|
160
|
|
- }finally{
|
161
|
|
- await _api.disconnect()
|
162
|
161
|
}
|
163
|
162
|
|
164
|
163
|
if (!tx || !tx.specification || !tx.specification['memos'] || !tx.specification['memos'][0]) {
|