Fix retrieving with pubkey object

pull/1224/head
Maxim Shishmarev 5 years ago
parent ae35626b35
commit 29fe64f5d5

@ -347,7 +347,7 @@ export async function storeOnNode(
export async function retrieveNextMessages( export async function retrieveNextMessages(
nodeData: Snode, nodeData: Snode,
lastHash: string, lastHash: string,
pubkey: PubKey pubkey: string
): Promise<Array<any>> { ): Promise<Array<any>> {
const params = { const params = {
pubKey: pubkey, pubKey: pubkey,

@ -119,11 +119,11 @@ export class SwarmPolling {
): Promise<Array<any>> { ): Promise<Array<any>> {
const edkey = node.pubkey_ed25519; const edkey = node.pubkey_ed25519;
const pkStr = pubkey.key ? pubkey.key : pubkey; const pkStr = (pubkey.key ? pubkey.key : pubkey) as string;
const prevHash = await this.getLastHash(edkey, pkStr as string); const prevHash = await this.getLastHash(edkey, pkStr);
const messages = await retrieveNextMessages(node, prevHash, pubkey); const messages = await retrieveNextMessages(node, prevHash, pkStr);
if (!messages.length) { if (!messages.length) {
return []; return [];

Loading…
Cancel
Save