forked from LBRYCommunity/lbry-sdk
only save the content claim if stream_hash isn't None
-stream_hash being none means we don't have the file in the database
This commit is contained in:
parent
6c0c0ee322
commit
324cbdcdb2
2 changed files with 6 additions and 1 deletions
|
@ -2503,7 +2503,8 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||||
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
||||||
)])
|
)])
|
||||||
await self.storage.save_content_claim(stream_hash, new_txo.id)
|
if stream_hash:
|
||||||
|
await self.storage.save_content_claim(stream_hash, new_txo.id)
|
||||||
await self.analytics_manager.send_claim_action('publish')
|
await self.analytics_manager.send_claim_action('publish')
|
||||||
else:
|
else:
|
||||||
await account.ledger.release_tx(tx)
|
await account.ledger.release_tx(tx)
|
||||||
|
|
|
@ -586,6 +586,10 @@ class StreamCommands(CommandTestCase):
|
||||||
self.assertEqual(txs[0]['value'], '0.0')
|
self.assertEqual(txs[0]['value'], '0.0')
|
||||||
self.assertEqual(txs[0]['fee'], '-0.020107')
|
self.assertEqual(txs[0]['fee'], '-0.020107')
|
||||||
await self.assertBalance(self.account, '7.479893')
|
await self.assertBalance(self.account, '7.479893')
|
||||||
|
self.assertEqual(1, len(self.daemon.jsonrpc_file_list()))
|
||||||
|
|
||||||
|
await self.daemon.jsonrpc_file_delete(delete_all=True)
|
||||||
|
self.assertEqual(0, len(self.daemon.jsonrpc_file_list()))
|
||||||
|
|
||||||
await self.stream_update(claim_id, bid='1.0') # updates previous claim
|
await self.stream_update(claim_id, bid='1.0') # updates previous claim
|
||||||
txs = await self.out(self.daemon.jsonrpc_transaction_list())
|
txs = await self.out(self.daemon.jsonrpc_transaction_list())
|
||||||
|
|
Loading…
Reference in a new issue