split program source file
This commit is contained in:
@@ -17,6 +17,8 @@ type TableInfo struct {
|
||||
addresses []solana.PublicKey
|
||||
}
|
||||
|
||||
const MaxOverErrCount = 10
|
||||
|
||||
type AddressTables struct {
|
||||
showTableLoaded bool
|
||||
|
||||
@@ -96,7 +98,7 @@ func (at *AddressTables) load(tablePubkey solana.PublicKey) {
|
||||
})
|
||||
}
|
||||
|
||||
func (at *AddressTables) FillToTx(tx *versionedTransaction, tablePubkey solana.PublicKey, idx []uint8) bool {
|
||||
func (at *AddressTables) FillToTx(tx *VersionedTransaction, tablePubkey solana.PublicKey, idx []uint8) bool {
|
||||
addresses, ok := at.tables.Get(tablePubkey)
|
||||
if !ok {
|
||||
at.load(tablePubkey)
|
||||
@@ -112,7 +114,7 @@ func (at *AddressTables) FillToTx(tx *versionedTransaction, tablePubkey solana.P
|
||||
}
|
||||
return false
|
||||
}
|
||||
tx.Message.StaticAccountKeys = append(tx.Message.StaticAccountKeys, addresses.addresses[i])
|
||||
tx.StaticAccountKeys = append(tx.StaticAccountKeys, addresses.addresses[i])
|
||||
}
|
||||
return true
|
||||
}
|
||||
@@ -129,7 +131,7 @@ func (at *AddressTables) GetAddressTable(tablePubkey solana.PublicKey, idx []uin
|
||||
if int(i) >= len(addresses.addresses) {
|
||||
logger.Error("over loadAddressTable failed", "idx", i, "table", tablePubkey)
|
||||
addresses.overErrCount++
|
||||
if addresses.overErrCount > 10 {
|
||||
if addresses.overErrCount > MaxOverErrCount {
|
||||
at.load(tablePubkey)
|
||||
}
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user