From 23adc7e496946669f0bba8c024f7f2bda0f4fcef Mon Sep 17 00:00:00 2001 From: Cassandra Heart Date: Sun, 20 Oct 2024 22:23:40 -0500 Subject: [PATCH] -b3 --- node/config/version.go | 2 +- node/store/coin.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/node/config/version.go b/node/config/version.go index 37e4e77..f00972f 100644 --- a/node/config/version.go +++ b/node/config/version.go @@ -40,5 +40,5 @@ func GetPatchNumber() byte { } func GetRCNumber() byte { - return 0x02 + return 0x03 } diff --git a/node/store/coin.go b/node/store/coin.go index f3fe0a9..469298b 100644 --- a/node/store/coin.go +++ b/node/store/coin.go @@ -68,8 +68,8 @@ func NewPebbleCoinStore( } const ( - COIN = 0x05 - PROOF = 0x06 + COIN = 0x07 + PROOF = 0x08 COIN_BY_ADDRESS = 0x00 COIN_BY_OWNER = 0x01 MIGRATION = 0x02 @@ -389,7 +389,7 @@ func (p *PebbleCoinStore) SetLatestFrameProcessed( } func (p *PebbleCoinStore) SetMigrationVersion() error { - if err := p.db.Set(migrationKey(), []byte{0x02, 0x00, 0x01}); err != nil { + if err := p.db.Set(migrationKey(), []byte{0x02, 0x00, 0x01, 0x03}); err != nil { return errors.Wrap(err, "set migration version") } @@ -408,16 +408,16 @@ func (p *PebbleCoinStore) Migrate(filter []byte) error { return nil } - err = txn.Set(migrationKey(), []byte{0x02, 0x00, 0x01, 0x02}) + err = txn.Set(migrationKey(), []byte{0x02, 0x00, 0x01, 0x03}) if err != nil { panic(err) } return txn.Commit() } else { defer closer.Close() - if len(status) == 4 && bytes.Compare(status, []byte{0x02, 0x00, 0x01, 0x02}) > 0 { + if len(status) == 4 && bytes.Compare(status, []byte{0x02, 0x00, 0x01, 0x03}) > 0 { panic("database has been migrated to a newer version, do not rollback") - } else if len(status) == 3 || bytes.Compare(status, []byte{0x02, 0x00, 0x01, 0x02}) < 0 { + } else if len(status) == 3 || bytes.Compare(status, []byte{0x02, 0x00, 0x01, 0x03}) < 0 { err = p.db.DeleteRange( coinByOwnerKey( bytes.Repeat([]byte{0x00}, 32), @@ -485,7 +485,7 @@ func (p *PebbleCoinStore) Migrate(filter []byte) error { return nil } - err = txn.Set(migrationKey(), []byte{0x02, 0x00, 0x01, 0x02}) + err = txn.Set(migrationKey(), []byte{0x02, 0x00, 0x01, 0x03}) if err != nil { panic(err) }