Interface BlockchainTransactionService


  • public interface BlockchainTransactionService
    • Method Detail

      • scanNewerBlocks

        void scanNewerBlocks()
                      throws IOException
        Scans newly mined blocks in Blockchain to verify if there are transactions on configured token or wallet. If found, save it in DB.
        Throws:
        IOException
      • sendRawTransactions

        void sendRawTransactions()
        Sends raw transactions to blockchain
      • checkTransactionStatusOnBlockchain

        void checkTransactionStatusOnBlockchain​(String transactionHash,
                                                boolean pendingTransactionFromDatabase)
        Checks transaction identified by its hash on blockchain to see if it's mined. If mined, the information will be retrieved from mined transaction and saved on database (by replacing existing while the transaction was pendinginformation for more data integrity)
        Parameters:
        transactionHash -
        pendingTransactionFromDatabase -
      • refreshTransactionFromBlockchain

        TransactionDetail refreshTransactionFromBlockchain​(String hash)
        This will refresh transaction from blockchain if the transaction is marked as pending or marked as error
        Parameters:
        hash - hash of transaction to update
        Returns:
        refreshed TransactionDetail from blockchain
      • checkPendingTransactionValidity

        void checkPendingTransactionValidity​(TransactionDetail transactionDetail)
        Checks that a transaction marked as pending in internal database is valid and available on blockchain. If not and if it has exceede WalletTransactionService.getPendingTransactionMaxDays(), then mark it as 'failed'. I will be remade as 'Success' if ContractTransactionVerifierJob detects a Contract Log
        Parameters:
        transactionDetail -
      • refreshBlockchainGasPrice

        long refreshBlockchainGasPrice()
                                throws IOException
        Refreshes gas price from blockchain and cache it
        Returns:
        last gas price retrieved from blockchain
        Throws:
        IOException - when an error occurs while requesting gas price from blockchain
      • checkPendingTransactions

        void checkPendingTransactions()
        checks transactions marked as pending in DB and verify their status on blockchain. If mined, the status gets updated on DB, else wait for next trigger time.