diff --git a/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift b/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift index 0783a50b..9b92fa4d 100644 --- a/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift +++ b/Sources/ZcashLightClientKit/DAO/PendingTransactionDao.swift @@ -152,7 +152,7 @@ struct PendingTransaction: PendingTransactionEntity, Decodable, Encodable { accountId = Int(acct) } - try container.encode(toAddress, forKey: .toAddress) + try container.encodeIfPresent(toAddress, forKey: .toAddress) try container.encodeIfPresent(accountId, forKey: .toInternalAccount) try container.encode(self.accountIndex, forKey: .accountIndex) try container.encode(self.minedHeight, forKey: .minedHeight)