Error when using msg.value twice

nexus20001nexus20001 Member Posts: 1
Hi guys,

I try to deploy the following code:
contract Sample {

struct Participant {
address etherAddress;
uint amount;

Participant[] public participants;
uint public amountRaised;

function() {

function enter() {
uint amount = msg.value;
uint n = participants.length;

participants.length += 1;
participants[n].etherAddress = msg.sender;
participants[n].amount = amount;

amountRaised += amount;

In Mix IDE it works correctly but does not work on Ethereum testnet(balance not changed).
You can try here:
I noticed that contract works if delete participants[n].amount = amount OR amountRaised += amount line.
So, I can use only one msg.value variable.
How can I use msg.value twice?
Sign In or Register to comment.