@@ -1470,7 +1470,8 @@ public Context transfer(Address target, long amount) {
1470
1470
}
1471
1471
AccountStatus targetAccount =accounts .get (targetIndex );
1472
1472
1473
- if (targetAccount .isActor ()) {
1473
+ // Special handling for an actor account other than #0 (burn address)
1474
+ if (targetAccount .isActor ()&&(!(target .longValue ()==0 ))) {
1474
1475
// (call target amount (receive-coin source amount nil))
1475
1476
// SECURITY: actorCall must do fork to preserve this
1476
1477
Context actx =this .fork ();
@@ -1479,19 +1480,18 @@ public Context transfer(Address target, long amount) {
1479
1480
1480
1481
long sent =currentBalance -actx .getBalance (source );
1481
1482
return actx .withResult (CVMLong .create (sent ));
1482
- } else {
1483
- // must be a user account
1484
- long oldTargetBalance =targetAccount .getBalance ();
1485
- long newTargetBalance =oldTargetBalance +amount ;
1486
- AccountStatus newTargetAccount =targetAccount .withBalance (newTargetBalance );
1487
- accounts =accounts .assoc (targetIndex , newTargetAccount );
1488
-
1489
- // SECURITY: new context with updated accounts
1490
- Context result =withChainState (chainState .withAccounts (accounts )).withResult (CVMLong .create (amount ));
1483
+ }
1484
+
1485
+ // must be a user account
1486
+ long oldTargetBalance =targetAccount .getBalance ();
1487
+ long newTargetBalance =oldTargetBalance +amount ;
1488
+ AccountStatus newTargetAccount =targetAccount .withBalance (newTargetBalance );
1489
+ accounts =accounts .assoc (targetIndex , newTargetAccount );
1491
1490
1492
- return result ;
1493
- }
1491
+ // SECURITY: new context with updated accounts
1492
+ Context result = withChainState ( chainState . withAccounts ( accounts )). withResult ( CVMLong . create ( amount ));
1494
1493
1494
+ return result ;
1495
1495
}
1496
1496
1497
1497
/**
0 commit comments