Skip to content

Commit 8e8e362

Browse files
committed
add back rebuilt flag
Signed-off-by: Chengxuan Xing <[email protected]>
1 parent d6f944c commit 8e8e362

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

pkg/ffcapi/api.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,18 @@ type API interface {
9696
}
9797

9898
type ConfirmationUpdateResult struct {
99-
// confirmation queue has a list of confirmed blocks for a transaction
100-
// the first block is the block that contains the transaction hash
99+
// a linked list of accumulated confirmations for a transaction
100+
// the list is sorted by block number
101+
// - the first block is the block that contains the transaction hash
102+
// - the last block is the most recent confirmation
103+
// this list can be used as input to the future reconcile request to avoid re-fetching the blocks if they are no longer
104+
// in the in-memory partial chain
105+
// WARNING: mutation to this list is not expected, invalid modifications will cause inefficiencies in the reconciliation process
106+
// `rebuilt` will be true if an invalid confirmation list is detected by the reconciliation process
101107
Confirmations []*MinimalBlockInfo `json:"confirmations,omitempty"`
102-
NewFork bool `json:"newFork,omitempty"` // when true, it means a fork is detected based on the existing confirmations
103-
Confirmed bool `json:"confirmed,omitempty"` // when true, it means the confirmation queue is complete and all the blocks are confirmed
108+
Rebuilt bool `json:"rebuilt,omitempty"` // when true, it means the existing confirmations contained invalid blocks, the new confirmations are rebuilt from scratch
109+
NewFork bool `json:"newFork,omitempty"` // when true, it means a new fork was detected based on the existing confirmations, this will always be false if `rebuilt` is true
110+
Confirmed bool `json:"confirmed,omitempty"` // when true, it means the confirmation list is complete and the transaction is confirmed
104111
TargetConfirmationCount uint64 `json:"targetConfirmationCount"` // the target number of confirmations for this reconcile request
105112
}
106113
type MinimalBlockInfo struct { // duplicate of apitypes.Confirmation due to circular dependency

0 commit comments

Comments
 (0)