diff --git a/packages/api-derive/src/tx/signingInfo.ts b/packages/api-derive/src/tx/signingInfo.ts index c056ced6cf..c29e150622 100644 --- a/packages/api-derive/src/tx/signingInfo.ts +++ b/packages/api-derive/src/tx/signingInfo.ts @@ -33,10 +33,16 @@ function nextNonce (api: ApiInterfaceRx, address: string): Observable { function signingHeader (api: ApiInterfaceRx): Observable
{ return combineLatest([ api.rpc.chain.getHeader(), - api.rpc.chain.getFinalizedHead().pipe( - switchMap((hash) => api.rpc.chain.getHeader(hash)) - ) + api.rpc.chain.getFinalizedHead() ]).pipe( + switchMap(([{ parentHash }, finHash]) => + // retrieve the headers - in the case of the current block, we use the parent + // to minimize (not completely remove) the impact that forks do have on the system + combineLatest([ + api.rpc.chain.getHeader(parentHash), + api.rpc.chain.getHeader(finHash) + ]) + ), map(([current, finalized]) => // determine the hash to use, current when lag > max, else finalized current.number.unwrap().sub(finalized.number.unwrap()).gt(MAX_FINALITY_LAG)