rpc/account; fixed mempool tx filter bug; fixed iavl_tree persistence

bug
This commit is contained in:
Jae Kwon
2015-01-10 05:41:50 -08:00
parent 4a81b06b6e
commit fe566739fd
15 changed files with 171 additions and 14 deletions

View File

@@ -110,7 +110,8 @@ func (s *State) Copy() *State {
// The accounts from the TxInputs must either already have
// account.PubKey.(type) != PubKeyNil, (it must be known),
// or it must be specified in the TxInput. But not both.
// or it must be specified in the TxInput. If redeclared,
// the TxInput is modified and input.PubKey set to PubKeyNil.
func (s *State) GetOrMakeAccounts(ins []*TxInput, outs []*TxOutput) (map[string]*Account, error) {
accounts := map[string]*Account{}
for _, in := range ins {
@@ -132,9 +133,7 @@ func (s *State) GetOrMakeAccounts(ins []*TxInput, outs []*TxOutput) (map[string]
}
account.PubKey = in.PubKey
} else {
if _, isNil := in.PubKey.(PubKeyNil); !isNil {
return nil, ErrTxRedeclaredPubKey
}
in.PubKey = PubKeyNil{}
}
accounts[string(in.Address)] = account
}