Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

node: Can't send all gas to an address in neo-cli #717

Closed
chenzhitong opened this issue Jan 15, 2021 · 8 comments
Closed

node: Can't send all gas to an address in neo-cli #717

chenzhitong opened this issue Jan 15, 2021 · 8 comments
Labels

Comments

@chenzhitong
Copy link
Member

image

Description
I want to transfer all my GAS to another address, and I can't do that in neo-cli.

Expected
Automatically deduct the fee and transfer the balance to this address.

Suggestion:
Can it automatically deduct the fee from the transfer amount when sending all?

@ProDog
Copy link
Contributor

ProDog commented Jan 15, 2021

A nice feature 🆒.

@shargon
Copy link
Member

shargon commented Jan 15, 2021

It can be done changing the type to string and parsing the string inside the method

@superboyiii
Copy link
Member

It can be done changing the type to string and parsing the string inside the method

Since we're still calculating NetFee per byte not per KB, how can we calculate that accurately if the tx is just over 1KB after signature is added.

@shargon
Copy link
Member

shargon commented Jan 15, 2021

Since we're still calculating NetFee per byte not per KB, how can we calculate that accurately if the tx is just over 1KB after signature is added.

With zero padding for the big integer amount. The size will be the same for 1 and for 10000000. You will need to compute only twice the transaction, one for get the fee with 0000000000000001, substract the fee from the amount and sign.

image

@shargon
Copy link
Member

shargon commented Jan 15, 2021

But it would be nice to have this neo-project/neo#2008 otherwise, you will earn gas :)

@superboyiii
Copy link
Member

Since we're still calculating NetFee per byte not per KB, how can we calculate that accurately if the tx is just over 1KB after signature is added.

With zero padding for the big integer amount. The size will be the same for 1 and for 10000000. You will need to compute only twice the transaction, one for get the fee with 0000000000000001, substract the fee from the amount and sign.

image

Yeah, size will be the same for 1 and 10000000. But we could have multi addresses in wallet especially the exchange. They often have few gas in many wallet. If one signature is added, the size is bigger then netfee will be increased, if the second address has not enough gas then CLI has to ask the third address for more fee and more recalculate. So the issue is we don't know how many times we have to calculate or CLI will return fault after tried twice.

@shargon
Copy link
Member

shargon commented Jan 15, 2021

We can try it 10 times?

@shargon shargon changed the title Can't send all gas to an address in neo-cli node: Can't send all gas to an address in neo-cli Dec 5, 2023
@shargon shargon added the node label Dec 5, 2023
@shargon
Copy link
Member

shargon commented Dec 5, 2023

Old, if remains, please re-open

@shargon shargon closed this as completed Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants