X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=blockchain%2Fwallet%2Fannotated.go;h=967e1ecf911e609d5731b9c97f3ff43d9abb7ee3;hb=6149b99ef48fbd78d54d2bc58b2e99696de338ba;hp=d86a5867eab1f0dd224146b61ef87274e30b94b4;hpb=1f59f1fd05b3507b929833629ef902ed772e8955;p=bytom%2Fbytom.git diff --git a/blockchain/wallet/annotated.go b/blockchain/wallet/annotated.go index d86a5867..967e1ecf 100755 --- a/blockchain/wallet/annotated.go +++ b/blockchain/wallet/annotated.go @@ -181,17 +181,19 @@ func isValidJSON(b []byte) bool { return err == nil } -func buildAnnotatedTransaction(orig *legacy.Tx, b *legacy.Block, indexInBlock uint32) *query.AnnotatedTx { +func buildAnnotatedTransaction(orig *legacy.Tx, b *legacy.Block, indexInBlock int) *query.AnnotatedTx { + statusFail, _ := b.TransactionStatus.GetStatus(indexInBlock) tx := &query.AnnotatedTx{ ID: orig.ID, Timestamp: b.Time(), BlockID: b.Hash(), BlockHeight: b.Height, - Position: indexInBlock, + Position: uint32(indexInBlock), BlockTransactionsCount: uint32(len(b.Transactions)), ReferenceData: &emptyJSONObject, Inputs: make([]*query.AnnotatedInput, 0, len(orig.Inputs)), Outputs: make([]*query.AnnotatedOutput, 0, len(orig.Outputs)), + StatusFail: statusFail, } if isValidJSON(orig.ReferenceData) { referenceData := json.RawMessage(orig.ReferenceData)