"Coin selection Insufficient funds" error

+2 votes

 

I have two nodes, A and B. After a certain period of time (~24 hours) the nodes become unresponsive and need to be restarted. On restart the following messages can be seen in the logs for A and B respectively:

Node A log

mchn: Coin selection: Insufficient funds, but there are coins belonging to addresses without send permission or P2SH addresses.

mchn: Coin selection: Insufficient funds, but there are coins belonging to addresses without send permission or P2SH addresses.keypool reserve 2
keypool return 2

Node B log

mchn: Coin selection: Insufficient fundsmchn: Coin selection: Insufficient fundsmchn: Coin selection: Insufficient fundsmchn: Coin selection: Insufficient fundskeypool reserve 2 keypool return 2

This is an intermittent issue, and could be related to the way in which the application we have built is interacting with MultiChain. 

I know the messages themselves allude to the problem i.e. insufficient funds :). Furthermore our application does lock funds and make offers, so our application could be at fault. But before jumping to conclusions I wanted to know if this is a generic error for a multitude of possible issues or is it specific to one thing? 

Any more info/clarity on these messages would be great

Thanks!

asked Jul 15, 2016 by Dylan
I've sent this over to the team and will get back to you.

1 Answer

+1 vote

First of all, thank you for this message. We've added "new line" between log records in the next Alpha.

"Insufficient funds" means exactly what it says. Wallet doesn't have enough unspent outputs to cover the asset amounts required in transaction you are trying to create with send... APIs. This may happen also if outputs cannot cover the fee (if you are using native currency). This may be result of insufficient number of confirmations - unspent outputs of transactions sent by another node can be used only after transaction was confirmed at least once.

The only special case of "Insufficient funds" is related to permissions. If you are trying to grant permissions, but you don't have unspent output belonging to admin, you will see this error too.  Or you are trying to issue new asset without having outputs with issue permission. But this should never happen if you are not using createrawtransaction mechanism.

"Insufficient funds, but there are coins belonging to addresses without send permission or P2SH addresses." also means what it says. Unspent outputs belonging to addresses without send permission and P2SH addresses cannot be used in coin selection.

Anyway, these messages mean that you are trying to send more than you have.

I don't know why your nodes became unresponsive, but when you restart, some of the transactions may be lost (at least until all nodes in the network are in sync). I don't know how your application decides what it can send, but it looks like nodes have different opinion on that.

 

 

 

 

answered Jul 18, 2016 by Michael
...