delegatebw 自己给自己抵押时报 Error 3050003: eosio_assert_message assertion failure
执行代码如下
root@iZj6cgy98yiuluw41gz0aoZ:~/.local/share/eosio/nodeos/config# cleos system delegatebw dappplaynode dappplaynode '10000000.0000 EOS' '10000000.0000 EOS' --transfer
2018-07-20T12:15:24.339 thread-0 main.cpp:438 create_action ] result: {"binargs":"a0129ddec45aab49a0129ddec45aab4900e876481700000004454f530000000000e876481700000004454f530000000001"} arg: {"code":"eosio","action":"delegatebw","args":{"from":"dappplaynode","receiver":"dappplaynode","stake_net_quantity":"10000000.0000 EOS","stake_cpu_quantity":"10000000.0000 EOS","transfer":true}}
Error 3050003: eosio_assert_message assertion failure
查看代码eos\contracts\eosio.system\delegate_bandwidth.cpp
void system_contract::changebw( account_name from, account_name receiver,
const asset stake_net_delta, const asset stake_cpu_delta, bool transfer )
{
......
// net and cpu are same sign by assertions in delegatebw and undelegatebw
// redundant assertion also at start of changebw to protect against misuse of changebw
bool is_undelegating = (net_balance.amount + cpu_balance.amount ) < 0;
bool is_delegating_to_self = (!transfer && from == receiver);
if( is_delegating_to_self || is_undelegating ) {
.......
}
抵押时不能再添加 --transfer
(此参数添加时,是说抵押同时将币的所有权转给接收者,但自己已经有所有权了,不能自己再转给自己)