diff --git a/services/gunDB/contact-api/actions.js b/services/gunDB/contact-api/actions.js index 9a994731..e81d5ff5 100644 --- a/services/gunDB/contact-api/actions.js +++ b/services/gunDB/contact-api/actions.js @@ -868,7 +868,7 @@ const sendPayment = async (to, amount, memo, gun, user, SEA) => { timestamp: Date.now() } - const currOrderAddress = await Getters.currentOrderAddress(to, gun) + const currOrderAddress = await Getters.currentOrderAddress(to) order.timestamp = Date.now() diff --git a/services/gunDB/contact-api/getters.js b/services/gunDB/contact-api/getters.js index f439512a..fa704e37 100644 --- a/services/gunDB/contact-api/getters.js +++ b/services/gunDB/contact-api/getters.js @@ -1,12 +1,12 @@ const Key = require('./key') +const Utils = require('./utils') /** * @param {string} pub - * @param {import('./SimpleGUN').GUNNode} gun * @returns {Promise} */ -exports.currentOrderAddress = async (pub, gun) => { - const currAddr = await gun.user(pub).get(Key.CURRENT_ORDER_ADDRESS).then() +exports.currentOrderAddress = async (pub) => { + const currAddr = await Utils.tryAndWait((gun) => gun.user(pub).get(Key.CURRENT_ORDER_ADDRESS).then()) if (typeof currAddr !== 'string') { throw new TypeError('Expected user.currentOrderAddress to be an string')