Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. // resendUnbroadcastedPayments()
  2. async monitorMinedPayments()
  3. {
  4.  
  5. var self = this ;
  6.  
  7. try {
  8.  
  9.  
  10. /*
  11. await this.redisInterface.storeRedisHashData('broadcasted_payment' ,balancePaymentId.toString(),JSON.stringify(broadcastedPaymentData) )
  12. await this.redisInterface.pushToRedisList(('broadcasted_payments'), JSON.stringify(broadcastedPaymentData) )
  13. await this.redisInterface.pushToRedisList(('unconfirmed_broadcasted_payments'), JSON.stringify(broadcastedPaymentData) )
  14. */
  15.  
  16. console.log('monitor mined payments ')
  17. var payment_txes = await this.redisInterface.getResultsOfKeyInRedis('balance_payment')
  18.  
  19.  
  20.  
  21. if( payment_txes != null && payment_txes.length > 0)
  22. {
  23. await this.checkMinedPayments( payment_txes )
  24. }
  25.  
  26.  
  27. }catch(e){
  28. console.log('error',e)
  29. }
  30.  
  31. setTimeout(function(){self.monitorMinedPayments()},4000)
  32.  
  33. },
  34.  
  35.  
  36.  
  37. async requestTransactionReceipt(tx_hash)
  38. {
  39. try{
  40. var receipt = await this.web3.eth.getTransactionReceipt(tx_hash);
  41. }catch(err)
  42. {
  43. console.error("could not find receipt ", tx_hash )
  44. }
  45. return receipt;
  46. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement