Skip to content

Commit 124589d

Browse files
authored
Only register account to receive coins if already unregistered (#336)
1 parent 9d4a6b8 commit 124589d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aptos/contracts/sources/pyth.move

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ module pyth::pyth {
6868
signer_capability
6969
);
7070
event::init(&pyth);
71-
coin::register<AptosCoin>(&pyth);
71+
if (!coin::is_account_registered<AptosCoin>(signer::address_of(&pyth))) {
72+
coin::register<AptosCoin>(&pyth);
73+
}
7274
}
7375

7476
fun parse_data_sources(

0 commit comments

Comments
 (0)