The logic of this function is quite simple: 1, mark inputs spent Call coins.Spend() 2, add new outputs to database. Call inputs.SetCoins()
My question is in step1, it invalidate the old output because it has been spent.
But in function coins.Spend(), I only found it kick out the spent output, I didn't find where the function update the database. If the old output is kicked, the database should also be updated, but coins.Spend() is only update the memory data structure.