Queued sendmany fail after the first few succeed

Thought I would post here before making a support ticket:
Does anyone have experience making a bunch of json-rpc z_sendmany calls (say, 10 to 20) in rapid sequence? When I do this to try to make a bunch of small transfers, the commands submit correctly and return an opid, but only the first few sends execute successfully. The remaining sends leave the queue, but return an “Insufficient funds” error. When I use z_getbalance to check, I find that the sending address balance is indeed too low, but if I wait a while (I haven’t timed it precisely, but I usually come back to this the next day), then I see that the original sender’s address is back to normal.
This is disconcerting that a few small sends appear to temporarily corrupt the balance of the sending address, if the sends are submitted too quickly.
Does anyone have any insight into this? I realize that I can combine the sends into a single json-rpc call to z_sendmany, but I am trying to verify that I understand why things work this way. Also – this is all on the testnet, not mainnet; I am mining on the testnet on another machine, though, to make sure the blocks are generated.
-All the best,

1 Like

Are you waiting for a confirmation before sending the next transaction? If not, your sending address could be in need of the change portion of the previous transaction.

Aha. No, I am not waiting for any confirmations. It has been a while since I read about the transaction details. Does the send involve moving the sender’s balance into an intermediate state, where it is then refunded “change” in order to make the final debit equal the transaction value?

With t-addrs the spendability and change stuff is the same as bitcoin in its mechanics…with a zaddr, you have to wait for the block to be mined for the rest of the balance on that zaddr to be spendable again. I had the same thing happen when I discovered this, wanted to send multiple txns from a zaddr at once, would have ordered them differently if I knew I had to wait so long between them!

… thanks a lot. Started reviewing the bitcoin wiki to learn some of this stuff again.