Merge pull request #523 from nspcc-dev/fix-interim-block-changes-store
Fix interim block changes store
This commit is contained in:
commit
c5e2b3ce73
2 changed files with 5 additions and 4 deletions
|
@ -1216,7 +1216,7 @@ func (bc *Blockchain) GetStandByValidators() (keys.PublicKeys, error) {
|
|||
|
||||
// GetValidators returns validators.
|
||||
// Golang implementation of GetValidators method in C# (https://github.com/neo-project/neo/blob/c64748ecbac3baeb8045b16af0d518398a6ced24/neo/Persistence/Snapshot.cs#L182)
|
||||
func (bc *Blockchain) GetValidators(txes... *transaction.Transaction) ([]*keys.PublicKey, error) {
|
||||
func (bc *Blockchain) GetValidators(txes ...*transaction.Transaction) ([]*keys.PublicKey, error) {
|
||||
chainState := NewBlockChainState(bc.store)
|
||||
if len(txes) > 0 {
|
||||
for _, tx := range txes {
|
||||
|
@ -1320,7 +1320,7 @@ func (bc *Blockchain) GetValidators(txes... *transaction.Transaction) ([]*keys.P
|
|||
return result, nil
|
||||
}
|
||||
|
||||
func processStateTX(chainState *BlockChainState, tx *transaction.StateTX, ) error {
|
||||
func processStateTX(chainState *BlockChainState, tx *transaction.StateTX) error {
|
||||
for _, desc := range tx.Descriptors {
|
||||
switch desc.Type {
|
||||
case transaction.Account:
|
||||
|
|
|
@ -19,8 +19,9 @@ type BlockChainState struct {
|
|||
|
||||
// NewBlockChainState creates blockchain state with it's memchached store.
|
||||
func NewBlockChainState(store *storage.MemCachedStore) *BlockChainState {
|
||||
tmpStore := storage.NewMemCachedStore(store)
|
||||
return &BlockChainState{
|
||||
store: store,
|
||||
store: tmpStore,
|
||||
unspentCoins: make(UnspentCoins),
|
||||
spentCoins: make(SpentCoins),
|
||||
accounts: make(Accounts),
|
||||
|
@ -31,7 +32,7 @@ func NewBlockChainState(store *storage.MemCachedStore) *BlockChainState {
|
|||
}
|
||||
|
||||
// commit commits all the data in current state into storage.
|
||||
func (state *BlockChainState) commit() error {
|
||||
func (state *BlockChainState) commit() error {
|
||||
if err := state.accounts.commit(state.store); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue