blockchain / service-my-wallet-v3

Blockchain Wallet API Service
https://blockchain.info/api/blockchain_wallet_api
GNU Affero General Public License v3.0
910 stars 518 forks source link

error: ERR_PUSHTX #105

Closed Jinsung-L closed 8 years ago

Jinsung-L commented 8 years ago

Please include your service-my-wallet-v3 and NodeJS version numbers when submitting an issue. Example: Service v0.18.0, Node v0.12.5

Service v0.21.3, Node v5.5.0

When I try to make a payment, I get {'error': 'Error signing and pushing transaction'} as the response, and error: ERR_PUSHTX from the service.

I checked #89. The error in #89 is caused because there were over 1000 addresses. But I don't have that much addresses, I think there are about 10, and I can successfully get the list and balance of the wallet. The error seems to occur only when I try to use payment api. My API url was: http://localhost:3000/merchant/[GUID]/payment?api_code=[API_KEY]&password=[PASSWORD]&to=[ADDRESS]&from=1&amount=10000&fee=44 which from parameter refers the index of my wallet. I tried to make fromparameter to be a specific address but the result was the same.

The wallet and address that I want to send bitcoin from were used in receive payments api v2.

So, essentially what I want to do is transferring bitcoins to a particular address from the receive address(or receive wallet) when I get paid by receive payments api v2.

jtormey commented 8 years ago

To spend from the xpub used with our receive payments API, you need to include from=[YOUR_XPUB]. There isn't a way to spend from a specific receive address.

Also, 44 satoshi is a very low fee and will prevent your transaction from going out. I recommend using no less than 5000 satoshi (the default value is 10000).

I'll make sure to add better error messages for the /payment endpoint, I realize 'Error signing and pushing transaction' is not very helpful.

Jinsung-L commented 8 years ago

Thank you! I resolved the problem. The reason was the too low fee as you mentioned. And actually from=[XPUB] didn't worked. I got this error from server

No origin set. 1463009677881 - error: ERR_BUILDTX

and this as the response

{'error': 'Error building transaction'}

Instead I had to use from=[WALLET_INDEX] and it worked. But the json response contained from parameter with the xpub string. No problem with that, but I think it will be better using xpub in both cases.

And I have 3 additional question.

  1. Does the 1000 address limit mean 1000 active addresses? or does that include active and archived addresses?
  2. Receive wallet for merchandising purpose generally should have more than 1000 addresses. How can I make the limit larger?
  3. Where can I see the list of archived addresses?

Thank you.

jtormey commented 8 years ago

Agreed, would be better to use the xpub in both cases. I'll include that in the next update.

The address limit is for active addresses only, and only applies for individual addresses (xpubs do not have this limit). If you need it to be increased, we can change the permissions of your API key to allow more addresses.

Right now the only way to see archived addresses is in the wallet itself. Although I'll work on adding that functionality directly to the API.

Jinsung-L commented 8 years ago

Good! If xpubs don't have the limit, since the Receive Payment API uses only xpub for creating new address, I think I don't need to increase my limit. By mean in the wallet itself, I guess you meant the Blockchain wallet interface. But I can't find any way to see archived addresses in https://blockchain.info/wallet/#/settings/1/addresses or else where in the web. Can you tell me the way to see archived address? or is there for now? I think I didn't understand your words.

And is there why to see the list of created receiving addresses by Receive Payment API? I'm storing the addresses so, I don't really need this functionality now, asking just for curiosity. Thank you!

jtormey commented 8 years ago

Archived addresses are at the bottom of this page: https://blockchain.info/wallet/#/settings/imported-addresses

There isn't a way to see a full list of receiving addresses at the moment. That's a good suggestion though and I'll look into adding it to this API. Thanks for your feedback!

Jinsung-L commented 8 years ago

Thank you for your answer! It was very helpful.