snet-daemon
snet-daemon copied to clipboard
Do not get channel state from blockchain at each call. It will save few seconds per call!
In the current version we get state of blockchain (channel.value and channel.expiration) at each call. It is free but it takes few seconds on kovan and presumably on mainnet, and it is not necessary. We should update local copy of blockchain state only then it is necessary.
by necessary you mean if " channel is close to expiration or has expired OR insufficient funds " , only then go and fetch this again from block chain just in case the channel has been extended and /or its more funds have been added ?
Exactly!
Just make sure that after you've initiated claim and have increased the nonce you should subtract claimed amount from the channel value.