From 1a40507eccbc8d77d0c7d4a142a4260582901e2c Mon Sep 17 00:00:00 2001 From: Sammy Libre Date: Mon, 1 Aug 2016 09:20:27 +0500 Subject: [PATCH] Add parity quirks mode for pending tx check --- payouts/payer.go | 2 +- rpc/rpc.go | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/payouts/payer.go b/payouts/payer.go index 8a960d5e1..687fc476a 100644 --- a/payouts/payer.go +++ b/payouts/payer.go @@ -200,7 +200,7 @@ func (u *PayoutsProcessor) process() { if err != nil { log.Printf("Failed to get tx receipt for %v: %v", txHash, err) } - if receipt != nil { + if receipt != nil && receipt.Confirmed() { break } } diff --git a/rpc/rpc.go b/rpc/rpc.go index 6b4b90264..766e8f092 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -47,8 +47,13 @@ type GetBlockReplyPart struct { } type TxReceipt struct { - TxHash string `json:"transactionHash"` - GasUsed string `json:"gasUsed"` + TxHash string `json:"transactionHash"` + GasUsed string `json:"gasUsed"` + BlockHash string `json:"blockHash"` +} + +func (r *TxReceipt) Confirmed() bool { + return len(r.BlockHash) > 0 } type Tx struct {