[EOSIO/eos] Identical transactions not allowed in smart contract (#5315)

I want to submit a transaction more than once with my smart contract, but this isn’t allowed, giving the following error:

`2018-08-18T18:42:28.712 thread-0 main.cpp:2888 main ] Failed with error: could not insert object, most likely a uniqueness constraint was violated (13)
`

The minimum working code to reproduce this error is:

«`
account_name leaser = N(myaccount);
asset stake_net_quantity(1);
asset stake_cpu_quantity(1);
eosio::transaction out;
out.actions.emplace_back(eosio::permission_level{_self, N(active) }, N(eosio), N(delegatebw), std::make_tuple(_self, leaser, stake_net_quantity, stake_cpu_quantity, false));
out.send(1, _self, false);
out.send(2, _self, false);
«`

Notice that the ID for sending is different in each case, but this doesn’t seem to matter.

How can I submit the same transaction more than once within the contract?

Добавить комментарий