Skip to content

Commit

Permalink
Merge pull request #2847 from joshstevens19/resolve-parity-get-block-…
Browse files Browse the repository at this point in the history
…by-block-number-error

Resolve parity nodes invalid "eth_getBlockByNumber" JSONRPC call
  • Loading branch information
nivida authored May 31, 2019
2 parents 9edeea0 + 50d2cca commit 9f95015
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/**
* @file TransactionObserver.js
* @author Samuel Furter <samuel@ethereum.org>
* @author Josh Stevens <joshstevens19@hotmail.co.uk>
* @date 2019
*/

Expand Down Expand Up @@ -147,8 +148,10 @@ export default class TransactionObserver {
this.getTransactionReceiptMethod.parameters = [transactionHash];

const receipt = await this.getTransactionReceiptMethod.execute();

if (receipt) {

// on parity nodes you can get the receipt without it being mined
// so the receipt may not have a block number at this point
if (receipt && receipt.blockNumber) {
if (this.lastBlock) {
const block = await this.getBlockByNumber(this.lastBlock.number + 1);

Expand Down

0 comments on commit 9f95015

Please sign in to comment.