Transaction layer:

+ apply wire received transaction
 + resolve pending transaction saved by the GUI dialog
This commit is contained in:
romanman 2014-07-04 18:07:46 +01:00
parent a0e379e54a
commit 24c3ed1d2c
2 changed files with 7 additions and 1 deletions

View File

@ -113,6 +113,7 @@ public class WorldManager {
BigInteger gasDebit = tx.getTotalGasValueDebit();
// The coinbase get the gas cost
if (coinbase != null)
repository.addBalance(coinbase, gasDebit);
byte[] contractAddress;

View File

@ -12,6 +12,7 @@ import java.util.Timer;
import java.util.TimerTask;
import org.ethereum.core.Block;
import org.ethereum.core.Transaction;
import org.ethereum.manager.MainData;
import org.ethereum.manager.WorldManager;
import org.ethereum.net.Command;
@ -202,6 +203,10 @@ public class EthereumProtocolHandler extends ChannelInboundHandlerAdapter {
RLPList rlpList = RLP.decode2(payload);
TransactionsMessage transactionsMessage = new TransactionsMessage(rlpList);
List<Transaction> txList = transactionsMessage.getTransactions();
for(Transaction tx : txList)
WorldManager.getInstance().applyTransaction(tx, null);
logger.info(transactionsMessage.toString());
if (peerListener != null) peerListener.console(transactionsMessage.toString());
}