Getting "no unspent outputs available" error when trying to publish to stream. What am I missing?

+2 votes


I'm using alpha-28, but have also tried updating to beta-1, which doesn't resolve the issue.

I'm spinning up 2 instances of multichain, one connecting to the other. I create a stream in the master and subscribe to it in both nodes. I have also configured the chain to allow anyone to connect, create, mine, and send. When publishing to the stream from the master node, it works as expected, but when attempting to publish from the second node, I get the following error:

No unspent outputs are available. Please send a transaction, with zero amount, to this node or address first and wait for its confirmation.

I'm not sure why this only occurs on the "slave" node and not the "master". I saw a forum question which seemed to be vaguely related, and the recommendation was to upgrade to alpha-29 or newer. I've tried with beta-1, but there's no difference in result. 

Am I missing something obvious? 


asked Apr 4, 2017 by Steven

1 Answer

+3 votes

Yes, this is a common issue in anyone-can-* blockchains, because a node (or address) cannot send that first transaction until it has had at lesat one transaction sent to it. You can solve this by some other node sending a zero quantity. Please see this answer for more details:

answered Apr 5, 2017 by MultiChain
Thanks for the quick response!

I suppose I could set a process running on the first node that wait for other nodes to connect and then sends a transaction. I don't suppose that having the second node send a transaction to itself would do the trick? Obviously, using anyone-can-* permissions isn't secure, I'm only doing this for a proof of concept.
Yes, I'm afraid you'd have to do something like this - sending a message off-chain from the second node to the first, containing its address.
When i sent a zero amount transaction to resolve the above issue then it gives me the error that:

error code: -25
error message:
Transaction was not signed properly

even when i have already imported this address to the blockchain.
You need to have the private key corresponding to an address in order to send a transaction from that address. It sounds like you used the "importaddress" command which only imports the address, but not its private key.
Yes, so I have used the importaddress command just to make sure that the address is watch-only address, then for the workaround I have used the createrawsendfrom, sign and send raw transaction APIs. The issue got resolved thereafter.
Thanks for the answer though.