Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when listing BTC transactions in Tribler wallet #4138

Closed
MattSkala opened this issue Jan 8, 2019 · 3 comments
Closed

Error when listing BTC transactions in Tribler wallet #4138

MattSkala opened this issue Jan 8, 2019 · 3 comments

Comments

@MattSkala
Copy link

MattSkala commented Jan 8, 2019

Tribler version/branch+revision:

tribler/devel#969defb61a3201ac23115b2cfe004cafadae9db2
bitcoinlib 0.4.4

Operating system and version:

Ubuntu 16.04

Steps to reproduce the behavior:
  1. Send a transaction to the Tribler BTC address
  2. GET http://localhost:8085/wallets/btc/transactions
Expected behavior:

The transaction should be visible in the transactions list.

Actual behavior:

The API call returns a server error:

{
	"error": {
		"message": "'NoneType' object has no attribute '__getitem__'",
		"code": "TypeError",
		"handled": false,
		"trace": ["  
                         File \"/usr/lib/python2.7/dist-packages/twisted/web/server.py\", line 183, in process\n    self.render(resrc)\n", "  
                         File \"/usr/lib/python2.7/dist-packages/twisted/web/server.py\", line 234, in render\n    body = resrc.render(self)\n", "  
                         File \"/usr/lib/python2.7/dist-packages/twisted/web/resource.py\", line 250, in render\n    return m(request)\n", "  
                         File \"/usr/local/lib/python2.7/dist-packages/Tribler/Core/Modules/restapi/wallets_endpoint.py\", line 221, in render_GET\n    self.session.lm.wallets[self.identifier].get_transactions().addCallback(on_transactions)\n", "  
                         File \"/usr/local/lib/python2.7/dist-packages/Tribler/Core/Modules/wallet/btc_wallet.py\", line 141, in get_transactions\n    transaction = Transaction.import_raw(db_result[0], network=self.network)\n", "  
                         File \"/usr/local/lib/python2.7/dist-packages/bitcoinlib/transactions.py\", line 1150, in import_raw\n    Contains 1 or more Input class object with UTXO's to spent and 1 or more Output class objects with destinations.\n", "  
                         File \"/usr/local/lib/python2.7/dist-packages/bitcoinlib/transactions.py\", line 60, in _transaction_deserialize\n    version = rawtx[0:4][::-1]\n"]
	}
}
@devos50 devos50 added this to the V7.2: Gigachannels milestone Jan 9, 2019
@MattSkala
Copy link
Author

After some debugging, I found out the problem is that the raw transaction is not stored in the database (the DbTransaction.raw column is empty). I submitted a PR to bitcoinlib which fixes that: 1200wd/bitcoinlib#75

@devos50
Copy link
Contributor

devos50 commented Jan 12, 2019

@MattSkala great work, thanks for debugging! 👍

@MattSkala MattSkala changed the title Error when transfering BTC from Tribler wallet Error when listing BTC transactions in Tribler wallet Jan 12, 2019
@MattSkala
Copy link
Author

The PR got merged, so I think we can close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants