OSDN Git Service

filter change output (#248)
authorHAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Mon, 8 Jul 2019 06:44:31 +0000 (14:44 +0800)
committerPaladz <yzhu101@uottawa.ca>
Mon, 8 Jul 2019 06:44:31 +0000 (14:44 +0800)
federation/synchron/mainchain_keeper.go

index 0c1612c..aeae20a 100644 (file)
@@ -138,11 +138,18 @@ func (m *mainchainKeeper) processBlock(chain *orm.Chain, block *types.Block, txS
 }
 
 func (m *mainchainKeeper) isDepositTx(tx *types.Tx) bool {
+       for _, input := range tx.Inputs {
+               if bytes.Equal(input.ControlProgram(), m.fedProg) {
+                       return false
+               }
+       }
+
        for _, output := range tx.Outputs {
                if bytes.Equal(output.OutputCommitment.ControlProgram, m.fedProg) {
                        return true
                }
        }
+
        return false
 }