Skip to content

Commit f47333e

Browse files
committed
Ensure fee collector is initialized in transaction server
1 parent de72bcd commit f47333e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/code/server/transaction/server.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type transactionServer struct {
3636
airdropperLock sync.Mutex
3737
airdropper *common.TimelockAccounts
3838

39-
// Not configured, since micropeayments require new implementation and are disabled
4039
feeCollector *common.Account
4140

4241
// todo: distributed locks
@@ -55,6 +54,8 @@ func NewTransactionServer(
5554
noncePool *transaction.LocalNoncePool,
5655
configProvider ConfigProvider,
5756
) (transactionpb.TransactionServer, error) {
57+
var err error
58+
5859
ctx := context.Background()
5960

6061
conf := configProvider()
@@ -85,6 +86,11 @@ func NewTransactionServer(
8586
giftCardLocks: sync_util.NewStripedLock(stripedLockParallelization),
8687
}
8788

89+
s.feeCollector, err = common.NewAccountFromPublicKeyString(s.conf.feeCollectorTokenPublicKey.Get(ctx))
90+
if err != nil {
91+
return nil, err
92+
}
93+
8894
airdropper := s.conf.airdropperOwnerPublicKey.Get(ctx)
8995
if len(airdropper) > 0 && airdropper != defaultAirdropperOwnerPublicKey {
9096
err := s.loadAirdropper(ctx)

0 commit comments

Comments
 (0)