Could you tell me if an RPC is executed atomically?
For example making a transaction between two accounts, I would have an RPC such:
1. client.rpc.provide('xfer', (data, response) => {
2. var srcWallet = getRecord(data.srcWalletId);
3. var dstWallet = getRecord(data.dstWalletId);
4. if (srcWallet.get('balance') >= data.xferAmount) {
5. srcWallet.set('balance', srcWallet.get('balance') - xferAmount);
6. dstWallet.set('balance', dstWallet.get('balance') + xferAmount);
7. }
Is it certain that the srcWallet balance cannot change between line 4 and 5?