icreator (OP)
Legendary
Offline
Activity: 1554
Merit: 1008
|
|
July 03, 2018, 09:04:19 PM |
|
?? Why I see this error code -3 ?? PYTHON code: print 'res = cc.sendtoaddress(addr, amo - txfee)', amo - txfee res = cc.sendtoaddress(addr, amo - txfee) print "SENDed? ", res
first run >>> balance 0.25229647 try send: 0.14307412BTC to 3QgwCppatHV847dA4BYv538aZq8xz6uWuv res = cc.sendtoaddress(addr, amo - txfee) 0.14297412 SENDed? {u'id': 1, u'result': None, u'error': {u'message': u'Invalid amount for send', u'code': -3}}
second run >>> balance 0.25229647 try send: 0.14307412BTC 3QgwCppatHV847dA4BYv538aZq8xz6uWuv res = cc.sendtoaddress(addr, amo - txfee) 0.14297412 SENDed? 032e3710d5ac263ddb8bc9f9e295b086c00af8997f7f7ad3af8beca99287f85f PAYed xcurr - res: {'payment_id': u'032e3710d5ac263ddb8bc9f9e295b086c00af8997f7f7ad3af8beca99287f85f', 'status': 'success'}
why?? balances not changed...
|
Erachain Blockchain is fully ready for use Digital Ecosystem based on blockchain technology for business and government with low transaction costs, identification and built-in functions. +Decentralized exchange of tokens in Erachain
|
|
|
|
|
|
"There should not be any signed int. If you've found a signed int
somewhere, please tell me (within the next 25 years please) and I'll
change it to unsigned int." -- Satoshi
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6631
Just writing some code
|
|
July 04, 2018, 12:08:12 AM |
|
The error has nothing to do with the wallet.
Error code -3 means that there was a type error. With the error message "invalid amount for send", the amount that was specified was less than or equal to 0. This means that your code probably has a bug in it where amo is too small.
|
|
|
|
RGBKey
|
|
July 04, 2018, 12:35:07 AM |
|
Are you sending the amounts in Satoshis, instead of in floating points? I'm unfamiliar with the interface that you're using but that would be the first thing I check.
|
|
|
|
icreator (OP)
Legendary
Offline
Activity: 1554
Merit: 1008
|
|
July 05, 2018, 11:21:38 AM |
|
The error has nothing to do with the wallet.
Error code -3 means that there was a type error. With the error message "invalid amount for send", the amount that was specified was less than or equal to 0. This means that your code probably has a bug in it where amo is too small.
no, amount in float is > 0 but some times when bitcoin rate move up or down and amount to send is updating and transaction was created successfully why? It only was on 0.15 version of core wallet
|
Erachain Blockchain is fully ready for use Digital Ecosystem based on blockchain technology for business and government with low transaction costs, identification and built-in functions. +Decentralized exchange of tokens in Erachain
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
July 05, 2018, 07:48:06 PM |
|
As achow101 already mentioned, it most probably is a bug in your code. Mind sharing the relevant parts? We can't spot your bug without anything to look at. but some times when bitcoin rate move up or down and amount to send is updating and transaction was created successfully
Could you explain this ? Why does the bitcoin rate (BTC/USD price ?) influence your ability to create transactions ? And what libary are you using? python-bitcoinrpc ( https://github.com/jgarzik/python-bitcoinrpc) ?
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6631
Just writing some code
|
|
July 05, 2018, 07:52:40 PM |
|
no, amount in float is > 0
That error code and string occur in only 4 places in the code, with each one protected by an if branch checking whether the amount given is <= 0. If you are getting this error, then your amount is being interpreted as being <= 0, regardless of what you intended it to be.
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
July 05, 2018, 08:00:25 PM |
|
no, amount in float is > 0
That error code and string occur in only 4 places in the code, with each one protected by an if branch checking whether the amount given is <= 0. If you are getting this error, then your amount is being interpreted as being <= 0, regardless of what you intended it to be. I don't think it is because the value is <= 0. According to OP, there is a value > 0 (at least thats what it looks like according to the output to the screen): print 'res = cc.sendtoaddress(addr, amo - txfee)', amo - txfee res = cc.sendtoaddress(addr, amo - txfee) 0.14297412
I assume it is a type error. Thats what status code -3 should be for: RPC_TYPE_ERROR = -3, //!< Unexpected type was passed as parameter
from: https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/rpc/protocol.h#L50
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6631
Just writing some code
|
|
July 05, 2018, 10:04:47 PM |
|
no, amount in float is > 0
That error code and string occur in only 4 places in the code, with each one protected by an if branch checking whether the amount given is <= 0. If you are getting this error, then your amount is being interpreted as being <= 0, regardless of what you intended it to be. I don't think it is because the value is <= 0. According to OP, there is a value > 0 (at least thats what it looks like according to the output to the screen): print 'res = cc.sendtoaddress(addr, amo - txfee)', amo - txfee res = cc.sendtoaddress(addr, amo - txfee) 0.14297412
I assume it is a type error. Thats what status code -3 should be for: RPC_TYPE_ERROR = -3, //!< Unexpected type was passed as parameter
from: https://github.com/bitcoin/bitcoin/blob/v0.15.0.1/src/rpc/protocol.h#L50Every RPC error comes with an error code and a message. The message was "Invalid amount for send". As I said earlier, this only appears in 4 places and is guarded by only a check for negative or 0 values. This error can only be triggered by having a negative or 0 amount. This is still a type error, but type error can still mean many things. In this case, the type is "positive decimal" which is not what is being provided.
|
|
|
|
icreator (OP)
Legendary
Offline
Activity: 1554
Merit: 1008
|
|
July 06, 2018, 08:00:29 PM |
|
?? Why I see this error code -3 ?? PYTHON code: print 'res = cc.sendtoaddress(addr, amo - txfee)', amo - txfee res = cc.sendtoaddress(addr, amo - txfee) print "SENDed? ", res
first run >>> balance 0.25229647 try send: 0.14307412BTC to 3QgwCppatHV847dA4BYv538aZq8xz6uWuv res = cc.sendtoaddress(addr, amo - txfee) 0.14297412 SENDed? {u'id': 1, u'result': None, u'error': {u'message': u'Invalid amount for send', u'code': -3}}
second run >>> balance 0.25229647 try send: 0.14307412BTC 3QgwCppatHV847dA4BYv538aZq8xz6uWuv res = cc.sendtoaddress(addr, amo - txfee) 0.14297412 SENDed? 032e3710d5ac263ddb8bc9f9e295b086c00af8997f7f7ad3af8beca99287f85f PAYed xcurr - res: {'payment_id': u'032e3710d5ac263ddb8bc9f9e295b086c00af8997f7f7ad3af8beca99287f85f', 'status': 'success'}
why?? balances not changed... as You see I print value of "amo - txfee" = 0.14297412 - and in first case it is INVALID but in another case the same value of "amo - txfee" = 0.14297412 - is GOOD and this error I got only when update core wallet to 0.15 version (( may be in 0.16 It will be fixed?
|
Erachain Blockchain is fully ready for use Digital Ecosystem based on blockchain technology for business and government with low transaction costs, identification and built-in functions. +Decentralized exchange of tokens in Erachain
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3388
Merit: 6631
Just writing some code
|
|
July 06, 2018, 09:58:32 PM |
|
as You see I print value of "amo - txfee" = 0.14297412 - and in first case it is INVALID but in another case the same value of "amo - txfee" = 0.14297412 - is GOOD
Can you print out the values for amo and txfee too? and this error I got only when update core wallet to 0.15 version (( may be in 0.16 It will be fixed?
No, it will not be fixed because 0.16 has the same error messages guarded by the same conditions. If you have an http packet inspection tool, you can intercept the packets being sent to your node and see what the actual JSON for the command is being sent. That will give you more information too about the error as you can see what was actually sent by your code.
|
|
|
|
|