fix readRaw disconnecting
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xrpio",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.nitowa.xyz/npm-packages/xrpio.git"
|
||||
|
||||
@@ -141,13 +141,7 @@ export const writeRaw = async (api: RippleAPI, data: Memo, from:
|
||||
|
||||
|
||||
export const readRaw = async (api: RippleAPI, hash: string): Promise<Memo> => {
|
||||
while(!api.isConnected()){
|
||||
try{
|
||||
await api.connect()
|
||||
}catch(e){
|
||||
//retry
|
||||
}
|
||||
}
|
||||
api = await cloneApi(api)
|
||||
let tx
|
||||
try {
|
||||
tx = await api.getTransaction(hash, {
|
||||
@@ -158,6 +152,8 @@ export const readRaw = async (api: RippleAPI, hash: string): Promise<Memo> => {
|
||||
console.log("READRAW ERR", e)
|
||||
// }
|
||||
throw e
|
||||
} finally {
|
||||
await api.disconnect()
|
||||
}
|
||||
|
||||
if (!tx || !tx.specification || !tx.specification['memos'] || !tx.specification['memos'][0]) {
|
||||
|
||||
Reference in New Issue
Block a user