@@ -57,9 +57,13 @@ func (cc *GethContractClient) Register(paymentAddress common.Address) error {
5757 return err
5858 }
5959 smartpool .Output .Printf ("Registering address %s to SmartPool contract by tx: %s\n " , paymentAddress .Hex (), tx .Hash ().Hex ())
60- errCode , errInfo := NewTxWatcher (
60+ errCode , errInfo , err := NewTxWatcher (
6161 tx , cc .node , blockNo , RegisterEventTopic ,
6262 cc .sender .Big ()).Wait ()
63+ if err != nil {
64+ smartpool .Output .Printf ("Tx: %s was not approved by the network in time.\n " , tx .Hash ().Hex ())
65+ return err
66+ }
6367 if errCode .Cmp (common .Big0 ) != 0 {
6468 smartpool .Output .Printf ("Error code: 0x%s - Error info: 0x%s\n " , errCode .Text (16 ), errInfo .Text (16 ))
6569 return errors .New (ErrorMsg (errCode , errInfo ))
@@ -94,9 +98,13 @@ func (cc *GethContractClient) SubmitClaim(
9498 smartpool .Output .Printf ("Submitting claim failed. Error: %s\n " , err )
9599 return err
96100 }
97- errCode , errInfo := NewTxWatcher (
101+ errCode , errInfo , err := NewTxWatcher (
98102 tx , cc .node , blockNo , SubmitClaimEventTopic ,
99103 cc .sender .Big ()).Wait ()
104+ if err != nil {
105+ smartpool .Output .Printf ("Tx: %s was not approved by the network in time.\n " , tx .Hash ().Hex ())
106+ return err
107+ }
100108 if errCode .Cmp (common .Big0 ) != 0 {
101109 smartpool .Output .Printf ("Error code: 0x%s - Error info: 0x%s\n " , errCode .Text (16 ), errInfo .Text (16 ))
102110 return errors .New (ErrorMsg (errCode , errInfo ))
@@ -124,9 +132,13 @@ func (cc *GethContractClient) VerifyClaim(
124132 smartpool .Output .Printf ("Verifying claim failed. Error: %s\n " , err )
125133 return err
126134 }
127- errCode , errInfo := NewTxWatcher (
135+ errCode , errInfo , err := NewTxWatcher (
128136 tx , cc .node , blockNo , VerifyClaimEventTopic ,
129137 cc .sender .Big ()).Wait ()
138+ if err != nil {
139+ smartpool .Output .Printf ("Tx: %s was not approved by the network in time.\n " , tx .Hash ().Hex ())
140+ return err
141+ }
130142 if errCode .Cmp (common .Big0 ) != 0 {
131143 smartpool .Output .Printf ("Error code: 0x%s - Error info: 0x%s\n " , errCode .Text (16 ), errInfo .Text (16 ))
132144 return errors .New (ErrorMsg (errCode , errInfo ))
@@ -146,9 +158,13 @@ func (cc *GethContractClient) SetEpochData(merkleRoot []*big.Int, fullSizeIn128R
146158 smartpool .Output .Printf ("Setting epoch data. Error: %s\n " , err )
147159 return err
148160 }
149- errCode , errInfo := NewTxWatcher (
161+ errCode , errInfo , err := NewTxWatcher (
150162 tx , cc .node , blockNo , SetEpochDataEventTopic ,
151163 cc .sender .Big ()).Wait ()
164+ if err != nil {
165+ smartpool .Output .Printf ("Tx: %s was not approved by the network in time.\n " , tx .Hash ().Hex ())
166+ return err
167+ }
152168 if errCode .Cmp (common .Big0 ) != 0 {
153169 smartpool .Output .Printf ("Error code: 0x%s - Error info: 0x%s\n " , errCode .Text (16 ), errInfo .Text (16 ))
154170 return errors .New (ErrorMsg (errCode , errInfo ))
0 commit comments