Produce blocks only if transaction is there
Is there any way to produce block only if transaction is there ?
Every block at least has one implicit onblock transaction which is required to process some system level events (like set producer, name bidding settlement,... etc). Also block header serves as confirmations of all the previous blocks produced by all producers. Any producer failed to generate a block has negative impact to the network confirmation time and thus the corresponding producer will get less reward.
But what if i want to produce only if there is a smart contract transaction. https://ethereum.stackexchange.com/questions/3151/how-to-make-miner-to-mine-only-when-there-are-pending-transactions Like we can do this in ethereum
There is no support in EOSIO for generating a block only when a contract transaction is submitted, and no plans to create such a feature.
You are welcome to customize the source for your own needs.