Skip to content

Commit

Permalink
guard against nil dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Aug 12, 2024
1 parent 53a902a commit a14c076
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ export declare class Status extends Message<Status> {
*/
isAbortRefunded: boolean;

/**
* when the CCTX was created. only populated on new transactions.
*
* @generated from field: int64 created_timestamp = 5;
*/
createdTimestamp: bigint;

constructor(data?: PartialMessage<Status>);

static readonly runtime: typeof proto3;
Expand Down
2 changes: 1 addition & 1 deletion x/crosschain/keeper/cctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (k Keeper) SetCctxAndNonceToCctxAndInboundHashToCctx(ctx sdk.Context, cctx
func (k Keeper) SetCrossChainTx(ctx sdk.Context, cctx types.CrossChainTx) {
// only set the update timestamp if the block height is >0 to allow
// for a genesis import
if ctx.BlockHeight() > 0 {
if cctx.CctxStatus != nil && ctx.BlockHeight() > 0 {
cctx.CctxStatus.LastUpdateTimestamp = ctx.BlockHeader().Time.Unix()
}
p := types.KeyPrefix(fmt.Sprintf("%s", types.CCTXKey))
Expand Down

0 comments on commit a14c076

Please sign in to comment.