diff --git a/service/handler/account.go b/service/handler/account.go index 53e5c85..3ea0fcc 100644 --- a/service/handler/account.go +++ b/service/handler/account.go @@ -9,8 +9,12 @@ import ( "encoding/json" ) -func saveNewAccount(tx document.CommonTx) { +//when new address not found or the tx is not success,this address will not be collected +func saveNewAccount(tx *document.CommonTx) { var accountModel document.Account + if document.TxStatusSuccess != tx.Status { + return + } switch tx.Type { case constant.TxTypeTransfer: accountModel.Address = tx.To diff --git a/service/handler/tx.go b/service/handler/tx.go index 964eef0..b0e8d35 100644 --- a/service/handler/tx.go +++ b/service/handler/tx.go @@ -30,7 +30,7 @@ func HandleTx(block *types.Block) (error) { //handleTokenFlow(blockWithTags, tx, &batch) // save new account address - saveNewAccount(tx) + saveNewAccount(&tx) } if len(batch) > 0 {