save channel keys into wallet before broadcasting

This commit is contained in:
Lex Berezhny 2019-07-24 17:30:21 -04:00
parent 046dd53913
commit 8a5bfe884a

View file

@ -1946,9 +1946,9 @@ class Daemon(metaclass=JSONRPCServerType):
if not preview: if not preview:
await tx.sign([account]) await tx.sign([account])
await self.broadcast_or_release(account, tx, blocking)
account.add_channel_private_key(txo.private_key) account.add_channel_private_key(txo.private_key)
self.default_wallet.save() self.default_wallet.save()
await self.broadcast_or_release(account, tx, blocking)
await self.storage.save_claims([self._old_get_temp_claim_info( await self.storage.save_claims([self._old_get_temp_claim_info(
tx, txo, claim_address, claim, name, dewies_to_lbc(amount) tx, txo, claim_address, claim, name, dewies_to_lbc(amount)
)]) )])
@ -2085,9 +2085,9 @@ class Daemon(metaclass=JSONRPCServerType):
if not preview: if not preview:
await tx.sign([account]) await tx.sign([account])
await self.broadcast_or_release(account, tx, blocking)
account.add_channel_private_key(new_txo.private_key) account.add_channel_private_key(new_txo.private_key)
self.default_wallet.save() self.default_wallet.save()
await self.broadcast_or_release(account, tx, blocking)
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)
)]) )])