While testing in Jungle and adding signatures to a transaction with the flag -p
, I see that if I add two signatures to a transaction I can see that both accounts used CPU for that transaction. Why? Also, the CPU cost is not split among accounts, both of them pay more or less the same amount, i.e., even the amount is not the same. Why?
In summary, my questions are:
- Why both accounts pay CPU after adding signatures with
-p
flag? - Why the CPU cost is not split?
- Why the CPU cost is not exactly the same for both accounts?
To see this in action, you can use the following script:
export account1=username1
export account2=username2
alias cleos="cleos -u http://jungle2.cryptolions.io:80"
cleos get account $account1 # See the CPU used before the Tx
cleos get account $account2 # See the CPU used before the Tx
# The following Tx debts CPU from account1 only
cleos transfer $account1 $account2 "0.0001 EOS" -p $account1
cleos get account $account1 # See the CPU used after the Tx (Changed)
cleos get account $account2 # See the CPU used after the Tx (No Change)
# The following Tx debts CPU from both accounts.
cleos transfer $account1 $account2 "0.0001 EOS" -p $account1 -p $account2
cleos get account $account1 # See the CPU used after the Tx (Changed)
cleos get account $account2 # See the CPU used after the Tx (Changed)
# uncomment the next line to see both signatures in the not-broadcasted Tx:
# cleos transfer $account1 $account2 "0.0001 EOS" -p $account1 -p $account2 -d